/* Ammon 1141 — "Notte reale" theme.
   Deep navy ground, burnished gold accents, raised cards with layered
   shadows, inset fields and restrained motion. Mobile first: floating dock
   under 1024px, sidebar navigation from 1024px. Every animation is disabled
   for people who ask the system to reduce motion. */

/* Fonts served from the portal (SIL OFL, vendor/fonts): the site no longer calls Google. */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/vendor/fonts/cinzel-5.3.0-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/vendor/fonts/cinzel-5.3.0-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Cyrillic (Russian, Ukrainian): Cinzel has no Cyrillic, so titles take Alegreya SC for those
   letters only (Latin stays Cinzel); Manrope ships its own Cyrillic. Loaded only when a page uses them. */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/vendor/fonts/alegreya-sc-5.3.0-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/vendor/fonts/alegreya-sc-5.3.0-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-cyrillic-800.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* Greek: same approach as Cyrillic, Alegreya SC for the title letters and Manrope's own Greek. */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/vendor/fonts/alegreya-sc-5.3.0-greek-500.woff2") format("woff2");
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/vendor/fonts/alegreya-sc-5.3.0-greek-700.woff2") format("woff2");
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-greek-400.woff2") format("woff2");
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-greek-500.woff2") format("woff2");
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-greek-600.woff2") format("woff2");
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-greek-700.woff2") format("woff2");
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/vendor/fonts/manrope-5.3.0-greek-800.woff2") format("woff2");
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

:root {
  color-scheme: dark;
  --bg: #0a0e1c;
  --bg-deep: #070a14;
  --surface: #141b33;
  --surface-2: #19223f;
  --inset: #0b1022;
  --text: #eef1fb;
  --text-soft: #cfd5ea;
  --muted: #a3acc9;
  --faint: #7d86a6;
  --line: rgba(160, 175, 230, 0.12);
  --line-strong: rgba(160, 175, 230, 0.22);
  --gold: #f4bd4f;
  --gold-a: #ffd36e;
  --gold-b: #e59a2f;
  --gold-soft: #f7cf7a;
  --ink: #1d1305;
  --hero-a: #26306a;
  --hero-b: #121a3c;
  --glow: rgba(244, 189, 79, 0.35);
  --green: #45e0a2;
  --green-bg: rgba(63, 216, 154, 0.14);
  --red: #ff8f93;
  --red-strong: #e5484d;
  --red-bg: rgba(229, 72, 77, 0.16);
  --blue: #aebcff;
  --blue-bg: rgba(110, 135, 255, 0.18);
  /* Colore fisso di ogni tipo di evento: usato solo per il marker (etichetta e data) */
  --kind-mge: #f4bd4f;
  --kind-mge-ink: #1d1305;
  --kind-ark: #ff8a65;
  --kind-ark-ink: #1a0703;
  --kind-barbarians: #ff6b6b;
  --kind-barbarians-ink: #2a0606;
  --kind-alliance_mobilization: #5cc8ff;
  --kind-alliance_mobilization-ink: #04121c;
  --kind-other: #b48cff;
  --kind-other-ink: #160a2e;
  --gold-grad: linear-gradient(135deg, var(--gold-a), var(--gold-b));
  --hero-grad: radial-gradient(120% 90% at 100% 0%, var(--hero-a) 0%, var(--hero-b) 70%);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 10px 28px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 18px 40px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.35);
  --inset-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --radius-sm: 14px;
  --display: "Cinzel", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  /* No rubber-band bounce: on iOS it drags the fixed bottom menu upwards. */
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(110, 120, 255, 0.16), transparent 60%),
    radial-gradient(50rem 30rem at -10% 110%, rgba(244, 189, 79, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

img {
  max-width: 100%;
}

a {
  color: var(--gold-soft);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--gold-a);
}

:focus-visible {
  outline: 2px solid var(--gold-a);
  outline-offset: 3px;
  border-radius: 8px;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4.2vw, 2.4rem);
  letter-spacing: 0.01em;
}

h2 {
  font-size: 1.15rem;
  font-weight: 800;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
}

p {
  margin: 0 0 0.75em;
}

small {
  color: var(--muted);
}

.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--gold-grad);
  color: var(--ink);
  font-weight: 800;
}

.skip:focus {
  left: 12px;
}

/* ---------- Motion ---------- */

@keyframes am-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes am-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.7);
    opacity: 0.3;
  }
}

@keyframes am-shine {
  0%,
  55% {
    transform: translateX(-160%) skewX(-18deg);
  }
  100% {
    transform: translateX(320%) skewX(-18deg);
  }
}

@keyframes am-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-26px, 22px) scale(1.08);
  }
}

@keyframes am-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes am-glow {
  0%,
  100% {
    filter: drop-shadow(0 8px 18px rgba(244, 189, 79, 0.25));
  }
  50% {
    filter: drop-shadow(0 10px 34px rgba(244, 189, 79, 0.6));
  }
}

@keyframes am-enter {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes am-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes am-twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes am-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

@keyframes tourFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tourSlide {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#main > *,
.entry-content > *,
.language-card > * {
  animation: am-rise 0.45s var(--ease) both;
}

#main > *:nth-child(2) {
  animation-delay: 50ms;
}
#main > *:nth-child(3) {
  animation-delay: 100ms;
}
#main > *:nth-child(4) {
  animation-delay: 150ms;
}
#main > *:nth-child(n + 5) {
  animation-delay: 200ms;
}

/* ---------- Buttons ---------- */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--gold-grad);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--glow);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

button:hover,
.button:hover {
  color: var(--ink);
  box-shadow: 0 10px 26px var(--glow);
}

button:active,
.button:active,
.event-row:active,
.governor-card:active,
.guide-card:active,
.menu-tile:active,
.language-choice:active,
.onboarding-choice:active,
.next-event:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

button.secondary,
.button.secondary {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

button.secondary:hover,
.button.secondary:hover {
  color: var(--gold-soft);
}

button.selected {
  background: var(--gold-grad);
  color: var(--ink);
}

.text-button,
button.text-button {
  min-height: 44px;
  padding: 0 6px;
  background: transparent;
  color: var(--gold-soft);
  box-shadow: none;
  font-weight: 700;
}

.text-button:hover {
  color: var(--gold-a);
  box-shadow: none;
}

.text-link {
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 8px;
  font-weight: 700;
  text-decoration: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.row-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Forms ---------- */

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--inset);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--inset-shadow);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold-soft) 50%), linear-gradient(135deg, var(--gold-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 52%,
    calc(100% - 16px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold-b);
  box-shadow:
    var(--inset-shadow),
    0 0 0 4px rgba(244, 189, 79, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  min-height: 22px;
  height: 22px;
  padding: 0;
  accent-color: var(--gold);
  box-shadow: none;
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}

.form-error {
  margin: 0;
  min-height: 1em;
  color: var(--red);
  font-weight: 700;
}

.form-error:empty {
  display: none;
}

form > p:last-child,
form > button[type="submit"],
form .form-footer {
  margin: 0;
}

.password-field {
  position: relative;
  display: block;
  width: 100%;
}

.password-field input {
  padding-right: 58px !important;
}

.password-toggle{position:absolute;top:50%;right:6px;width:44px;height:44px;min-height:44px;padding:0;transform:translateY(-50%);border-radius:12px;background:transparent;color:var(--muted);box-shadow:none}

.password-toggle:hover {
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.password-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.otp {
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 1.4rem;
}

.search {
  margin: 0 0 18px;
}

/* ---------- Notices, badges ---------- */

.notice {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}

.notice.warning {
  background: linear-gradient(135deg, rgba(244, 189, 79, 0.16), rgba(244, 189, 79, 0.04)), var(--surface);
  color: var(--gold-soft);
}

.notice.success {
  background: linear-gradient(135deg, rgba(63, 216, 154, 0.16), rgba(63, 216, 154, 0.04)), var(--surface);
  color: var(--green);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge.open,
.badge.verified,
.badge.accepted,
.badge.registered,
.badge.available,
.badge.resolved,
.badge.live,
.badge.ticketOpen {
  background: var(--green-bg);
  color: var(--green);
}

.badge.scheduled,
.badge.pending,
.badge.submitted,
.badge.needs_changes,
.badge.waitlisted,
.badge.in_progress,
.badge.waiting_player,
.badge.unverified {
  background: rgba(244, 189, 79, 0.16);
  color: var(--gold-soft);
}

.badge.rejected,
.badge.cancelled,
.badge.suspended,
.badge.unavailable {
  background: var(--red-bg);
  color: var(--red);
}

.badge.closed,
.badge.ended,
.badge.archived {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.badge.open::before,
.badge.ticketOpen::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: am-pulse 2s ease-in-out infinite;
}

.count,
.history-count,
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.nav-badge {
  background: var(--red-strong);
  color: #fff;
  box-shadow: none;
}

/* Request status ("In valutazione"): a word, not a number, so the pill grows with it. */
.nav-badge.nav-badge-status {
  flex-shrink: 0;
  height: auto;
  min-height: 22px;
  padding: 3px 9px;
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}

/* ---------- Generic surfaces ---------- */

.panel {
  margin: 0 0 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel.narrow {
  max-width: 760px;
}

.panel.success {
  background: linear-gradient(160deg, rgba(63, 216, 154, 0.12), transparent 55%), var(--surface);
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}

.page-heading h1 {
  margin: 0;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
}

.next-heading {
  margin-top: 26px;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

tr.is-you td,
.player-row.is-you {
  background: rgba(244, 189, 79, 0.1);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.metric-grid > div {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-grid dt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.metric-grid dd {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- Language gate and login ---------- */

.language-gate,
.entry {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(32px + env(safe-area-inset-top)) 18px calc(40px + env(safe-area-inset-bottom));
}

.gate-orb {
  position: absolute;
  top: -140px;
  right: -110px;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  background: rgba(110, 120, 255, 0.38);
  filter: blur(80px);
  animation: am-float 16s ease-in-out infinite;
  pointer-events: none;
}

.language-card,
.entry-content {
  position: relative;
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.language-card {
  text-align: center;
}

.language-card h1 {
  margin: 6px 0 0;
}

.language-intro {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Phrases in every portal language scrolling to the left (web/js/ui.js ticker, web/index.html). */
.ticker {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.ticker-track {
  display: inline-flex;
  animation: ticker-left 22s linear infinite;
}

.ticker-copy {
  display: inline-flex;
}

.ticker-copy > span::after {
  content: "·";
  padding: 0 0.9em;
  color: var(--gold-b);
}

.gate-ticker {
  width: min(560px, 86vw);
  margin: 0 auto;
}

@keyframes ticker-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker {
    white-space: normal;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .ticker-track {
    display: inline;
    animation: none;
  }

  .ticker-copy {
    display: inline;
  }

  .ticker-copy + .ticker-copy {
    display: none;
  }
}




























/* brand-intro.js (anime.js) reveals these pages; the old CSS entrance animations stay off. */
.language-card > *,
.entry-content > * {
  animation: none;
}

.language-options{display:grid;grid-template-columns:1fr;gap:10px}

.language-choice {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 68px;
  padding: 0 18px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.language-choice:hover,
.language-choice:focus-visible {
  border-color: var(--gold-b);
  background: var(--hero-grad);
  color: var(--text);
  box-shadow:
    var(--shadow-lg),
    0 0 0 4px var(--glow);
}

.language-choice strong {
  flex: 1;
  font-size: 1.05rem;
}

.language-flag {
  display: block;
  width: 40px;
  height: 28px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.language-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.language-code {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.language-arrow {
  color: var(--gold-soft);
  font-weight: 800;
}

.entry-brand {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  width: min(100%, 460px);
  margin: 0 0 4px;
}

.entry-brand select {
  min-height: 42px;
  width: auto;
  padding: 0 40px 0 14px;
  border-radius: 999px;
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
}

.entry-content {
  text-align: left;
}

.entry-content h1 {
  margin: 4px 0 0;
  text-align: center;
}

.entry-intro {
  margin: 0 0 6px;
  text-align: center;
  color: var(--muted);
}

.entry-content > form,
.entry-auth > form {
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.entry-content > form button[type="submit"],
.entry-auth > form button[type="submit"] {
  width: 100%;
  min-height: 54px;
  font-size: 1rem;
}

.entry-content > .text-button,
.entry-auth > .text-button {
  align-self: center;
}

/* The sign-in form, its links and notice, revealed together after the brand intro. */
.entry-auth {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.entry footer {
  position: relative;
  margin-top: 26px;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  color: var(--faint);
}

.entry-email {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.entry-email summary {
  cursor: pointer;
  font-weight: 700;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.persona {
  flex-direction: column;
  align-items: flex-start;
  min-height: 110px;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.persona-number {
  color: var(--gold-soft);
  font-size: 0.8rem;
}

.persona span:last-child {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

/* ---------- App shell ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(10, 14, 28, 0.6));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px var(--glow));
}

.brand span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.brand small {
  overflow: hidden;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.masthead-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.masthead-tools > .lang-menu {
  display: none;
}

.game-clock {
  display: grid;
  justify-items: end;
  line-height: 1.1;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.game-clock small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.game-clock b {
  font-size: 0.85rem;
}

@media (max-width: 519px) {
  .game-clock small {
    display: none;
  }

  .game-clock b {
    font-size: 0.75rem;
  }
}

.view-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border-radius: 999px;
  background: var(--inset);
  box-shadow: var(--inset-shadow);
}

.view-switch button {
  position: relative;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  box-shadow: none;
}

.view-switch button[aria-pressed="true"] {
  background: var(--gold-grad);
  color: var(--ink);
  box-shadow: 0 4px 12px var(--glow);
}

.view-switch button[data-count]::after {
  content: attr(data-count);
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--red-strong);
  color: #fff;
  font-size: 0.65rem;
}

.view-switch-full {
  display: none;
}

.notification-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.notification-link svg {
  width: 21px;
  height: 21px;
}

.notification-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.notification-link b {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold-grad);
  color: var(--ink);
  font-size: 0.65rem;
  line-height: 18px;
  text-align: center;
}

.notification-link b:empty,
.notification-link b:is([data-zero]) {
  display: none;
}

.main-navigation {
  display: none;
}

.workspace {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 120px;
}

.workspace > footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.8rem;
}

.footer-brand {
  font-family: var(--display);
  letter-spacing: 0.2em;
  color: var(--muted);
}

.mobile-dock {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  /* Only part of the home-indicator inset: the labels sit just above the
     indicator bar instead of leaving a 34 pt empty band under them. */
  padding: 6px 8px max(6px, calc(env(safe-area-inset-bottom) - 18px));
  border-radius: 22px 22px 0 0;
  background: rgba(20, 27, 51, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.mobile-dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  border-radius: 18px;
  color: var(--faint);
  min-width: 0;
  padding: 0 2px;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.mobile-dock a span {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mobile-dock svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.mobile-dock a.active {
  background: var(--gold-grad);
  color: var(--ink);
  box-shadow: 0 8px 18px var(--glow);
}

body:has(textarea:focus) .mobile-dock,
body:has(input:not([type="checkbox"]):focus) .mobile-dock {
  transform: translateY(140%);
}

/* Phone and tablet: the page itself never scrolls, only .workspace does.
   With document scrolling, iOS moves the fixed dock together with the
   collapsing toolbar and the rubber-band bounce; with an inner scroller the
   dock stays anchored to the bottom of the screen on every page. */
@media (max-width: 1023.98px) {
  html:has(#app > .mobile-dock),
  html:has(#app > .mobile-dock) body {
    height: 100%;
    overflow: hidden;
  }

  /* iOS 26 home-screen app: with a translucent status bar the web view is one
     status bar short at the bottom (WebKit bug 301108) and nothing can paint
     there. index.html therefore uses the opaque "black" status bar. */
  #app:has(> .mobile-dock) {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
  }

  /* The dock is the last row of the frame, not a fixed overlay. */
  #app:has(> .mobile-dock) > .mobile-dock {
    position: relative;
    flex: none;
  }

  #app:has(> .mobile-dock) > .workspace {
    padding-bottom: 28px;
  }

  body:has(textarea:focus) #app > .mobile-dock,
  body:has(input:not([type="checkbox"]):focus) #app > .mobile-dock {
    display: none;
  }

  #app:has(> .mobile-dock) .lineup-panel form > .actions {
    bottom: 12px;
  }

  #app:has(> .mobile-dock) > .masthead {
    flex: none;
  }

  #app:has(> .mobile-dock) > .workspace {
    order: 0;
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* Desktop: sidebar navigation, no dock. */
@media (min-width: 1024px) {
  #app:has(> .masthead) {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }

  .masthead {
    grid-column: 1 / -1;
    padding: 12px 28px;
  }

  .brand img {
    width: 48px;
    height: 48px;
  }

  .brand span {
    font-size: 1.15rem;
  }

  .masthead-tools > .lang-menu {
    display: block;
  }

  .view-switch-full {
    display: inline;
  }

  .view-switch-short {
    display: none;
  }

  .main-navigation {
    position: sticky;
    top: 78px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 20px 0 20px 20px;
    padding: 12px;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .primary-links,
  .extra-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .extra-links {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .main-navigation a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    color: var(--text-soft);
    font-weight: 700;
    text-decoration: none;
    transition:
      background-color 0.2s ease,
      color 0.2s ease;
  }

  .main-navigation a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
  }

  .main-navigation a.active {
    background: var(--gold-grad);
    color: var(--ink);
    box-shadow: 0 8px 18px var(--glow);
  }

  .main-navigation svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  /* A status word does not fit next to the label: it goes on its own line under it. */
  .main-navigation a:has(.nav-badge-status) {
    flex-wrap: wrap;
    row-gap: 4px;
    padding-block: 8px;
  }

  .main-navigation a:has(.nav-badge-status) > span {
    flex: 1 0 calc(100% - 32px);
    min-width: 0;
  }

  .main-navigation .nav-badge-status {
    margin-left: 32px;
  }

  .more-navigation {
    display: none;
  }

  .workspace {
    padding: 24px 32px 48px;
  }

  .mobile-dock {
    display: none;
  }
}

/* ---------- Home ---------- */

.welcome {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 190px;
  margin: 0 0 18px;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(10, 14, 28, 0.05) 15%, rgba(10, 14, 28, 0.94) 100%),
    url("/assets/home.webp") 70% 30% / cover no-repeat;
  box-shadow: var(--shadow-lg);
}

.welcome h1 {
  margin: 0 0 4px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.welcome p:last-child {
  margin: 0;
  max-width: 560px;
  color: var(--text-soft);
}

.next-event {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
  padding: 20px 18px 18px;
  border-radius: 24px;
  background: var(--hero-grad);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s ease;
}

.next-event::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 70px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  animation: am-shine 5s ease-in-out infinite;
  pointer-events: none;
}

.next-event:hover {
  color: var(--text);
}

.next-event-kind {
  align-self: flex-start;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--kind, var(--gold-grad));
  color: var(--kind-ink, var(--ink));
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.event-row.mge,
.next-event.mge,
.my-registration.mge {
  --kind: var(--kind-mge);
  --kind-ink: var(--kind-mge-ink);
}

.event-row.ark,
.next-event.ark,
.my-registration.ark {
  --kind: var(--kind-ark);
  --kind-ink: var(--kind-ark-ink);
}

.event-row.barbarians,
.next-event.barbarians,
.my-registration.barbarians {
  --kind: var(--kind-barbarians);
  --kind-ink: var(--kind-barbarians-ink);
}

.event-row.alliance_mobilization,
.next-event.alliance_mobilization,
.my-registration.alliance_mobilization {
  --kind: var(--kind-alliance_mobilization);
  --kind-ink: var(--kind-alliance_mobilization-ink);
}

.event-row.other,
.next-event.other,
.my-registration.other {
  --kind: var(--kind-other);
  --kind-ink: var(--kind-other-ink);
}

.next-event-title {
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1.2;
}

.next-event-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-width: 420px;
}

.countdown > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.countdown b {
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.countdown small {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.next-event-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.next-event-dates > span {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  font-weight: 700;
}

.next-event-dates small {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.updates,
.my-registrations-panel {
  align-self: start;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.my-registrations-panel h3 {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.my-registration small {
  color: var(--muted);
}

.my-registrations-panel > button {
  margin-top: 12px;
}

.updates .notification {
  padding: 12px 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.updates > .button {
  margin-top: 12px;
}

/* Kingdom announcements sit at the top of Home. */
.home-announcements {
  margin: 0 0 18px;
}

.announcement-card {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 14px;
  margin: 0 0 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.announcement-card.featured {
  padding: 20px 18px;
  border-color: rgba(244, 189, 79, 0.38);
  background:
    radial-gradient(28rem 14rem at 100% 0%, rgba(244, 189, 79, 0.16), transparent 70%),
    var(--hero-grad);
  box-shadow: var(--shadow-lg);
}

.announcement-card.featured::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--gold-grad);
}

.announcement-card.must-confirm {
  border-color: rgba(255, 107, 107, 0.45);
}

.announcement-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(244, 189, 79, 0.14);
  color: var(--gold);
}

.announcement-card.featured .announcement-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--gold-grad);
  color: var(--ink);
  box-shadow: 0 8px 18px var(--glow);
}

.announcement-icon svg {
  width: 21px;
  height: 21px;
}

.announcement-body {
  flex: 1;
  min-width: 0;
}

.announcement-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.announcement-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.announcement-tag.new {
  background: var(--kind-alliance_mobilization);
  color: var(--kind-alliance_mobilization-ink);
}

.announcement-tag.confirm {
  background: var(--kind-barbarians);
  color: var(--kind-barbarians-ink);
}

.announcement-card h3 {
  margin: 6px 0 4px;
  font-family: var(--display);
  font-size: 1.02rem;
  line-height: 1.25;
}

.announcement-card.featured h3 {
  font-size: 1.25rem;
}

.announcement-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--text-soft);
  white-space: pre-line;
}

.announcement-card.featured .announcement-text {
  -webkit-line-clamp: 5;
}

.announcement-text.full {
  display: block;
  overflow: visible;
  -webkit-line-clamp: none;
}

.announcement-feed .announcement-card {
  margin-bottom: 12px;
}

.announcement-actions .announcement-delete {
  min-height: 0;
  margin-left: auto;
  padding: 0;
  color: var(--kind-barbarians);
  font-size: 0.8rem;
}

.announcement-confirmations {
  margin-top: 26px;
}

.announcement-confirmations summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.announcement-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

/* Home events: one tile per type, the colour lives on the marker only. */
.type-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.type-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.type-tile.mge {
  --kind: var(--kind-mge);
  --kind-ink: var(--kind-mge-ink);
}

.type-tile.ark {
  --kind: var(--kind-ark);
  --kind-ink: var(--kind-ark-ink);
}

.type-tile.barbarians {
  --kind: var(--kind-barbarians);
  --kind-ink: var(--kind-barbarians-ink);
}

.type-tile.alliance_mobilization {
  --kind: var(--kind-alliance_mobilization);
  --kind-ink: var(--kind-alliance_mobilization-ink);
}

.type-tile.other {
  --kind: var(--kind-other);
  --kind-ink: var(--kind-other-ink);
}

.type-tile button {
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
}

.type-tile .type-tile-head {
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px 6px;
  background: none;
  color: var(--text);
  text-align: left;
}

.type-tile .type-tile-head:hover {
  color: var(--gold-soft);
  box-shadow: none;
}

.type-tile-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
}

.type-tile-name {
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--kind, var(--gold));
  color: var(--kind-ink, var(--ink));
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.type-tile-count {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  color: var(--text);
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 800;
}

.type-tile-events {
  display: flex;
  flex-direction: column;
  padding: 0 6px 8px;
}

.type-event {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.type-event:hover {
  background: var(--surface-2);
  color: var(--text);
}

.type-event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  border-top: 2px solid var(--kind, var(--gold));
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.type-event-date strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.1;
}

.type-event-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.type-tile .type-tile-more {
  margin: 0 8px 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8rem;
}

.type-tile .type-tile-more:hover {
  color: var(--gold-soft);
  box-shadow: none;
}

.type-event-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.type-event .badge {
  padding: 2px 8px;
  font-size: 0.66rem;
}

/* Staff overview: four counters, the MGE one highlighted in gold. */
.staff-overview {
  background: var(--surface);
}

/* Each counter is a shortcut to its queue; gold only when something waits. */
.staff-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  min-height: 104px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.staff-tile:hover {
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.staff-tile span {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--muted);
}

.staff-tile b {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

.staff-tile small {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--faint);
}

.staff-tile.hot {
  background: var(--gold-grad);
  box-shadow: 0 12px 28px var(--glow);
}

.staff-tile.hot span,
.staff-tile.hot b,
.staff-tile.hot small {
  color: var(--ink);
}

.admin-block {
  margin: 28px 0 0;
  scroll-margin-top: 90px;
}

.admin-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  max-width: 560px;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: 18px;
  background: var(--inset);
  box-shadow: var(--inset-shadow);
}

.admin-tabs button {
  min-height: 44px;
  padding: 0 8px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.15;
  box-shadow: none;
}

.admin-tabs button:hover {
  color: var(--text);
  box-shadow: none;
}

.admin-tabs button[aria-selected="true"] {
  background: var(--gold-grad);
  color: var(--ink);
  box-shadow: 0 6px 16px var(--glow);
}

.admin-tabs button span {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
}

.admin-tabs button[aria-selected="true"] span {
  background: rgba(29, 19, 5, 0.15);
}

.admin-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 14px;
}

.admin-tabs-row .admin-tabs {
  flex: 1 1 360px;
  margin: 0;
}

.signup-resend {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

button.resend-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(174, 188, 255, 0.35);
  border-radius: 14px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: none;
}

button.resend-button:hover {
  border-color: var(--blue);
  color: var(--text);
}

.signup-hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--gold);
  cursor: help;
}

.signup-hint .icon {
  width: 22px;
  height: 22px;
}

.signup-hint b {
  font-size: 0.75rem;
}

/* The message opens on hover, or on tap and keyboard focus. */
.signup-hint::after {
  content: attr(data-hint);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: max(100%, 240px);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
}

.signup-hint:hover::after,
.signup-hint:focus::after {
  opacity: 1;
  visibility: visible;
}

.admin-request-tools {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-chips button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.request-row {
  margin: 0 0 8px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.request-row summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
}

.request-row summary::-webkit-details-marker {
  display: none;
}

.request-row-name,
.request-row-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.request-row-name strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.request-row-meta {
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.request-row[open] summary {
  border-bottom: 1px solid var(--line);
}

.request-row .admin-request-card {
  margin: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 719px) {
  .admin-tabs button {
    flex-direction: column;
    gap: 3px;
    min-height: 56px;
    font-size: 0.8rem;
  }
}

/* On narrow phones the crest alone identifies the portal; the name would be cut. */
@media (max-width: 420px) {
  .brand span {
    display: none;
  }
}

@media (min-width: 720px) {
  .admin-request-tools {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
}

.staff-task-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.staff-task-list li a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  text-decoration: none;
}

.staff-task-list li a:hover {
  color: var(--gold-soft);
}

@media (min-width: 900px) {
  .home-columns {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .welcome {
    min-height: 240px;
    padding: 30px;
  }
}

/* ---------- Events ---------- */

.events-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.events-heading {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 150px;
  margin: 0 0 16px;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(10, 14, 28, 0.94) 0%, rgba(10, 14, 28, 0.2) 80%),
    url("/assets/events.webp") 75% 40% / cover no-repeat;
  box-shadow: var(--shadow-lg);
}

.events-heading .page-heading {
  margin: 0 0 4px;
}

.events-heading p {
  margin: 0;
  max-width: 520px;
  color: var(--text-soft);
}

.event-filters {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.event-filters::-webkit-scrollbar {
  display: none;
}

.event-filters button {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.event-group {
  margin: 0 0 22px;
}

.event-row,
.event-group .event-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0 0 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.event-date,
.event-group .event-date{display:grid;place-items:center;align-content:center;gap:2px;width:58px;height:64px;border-radius:14px;background:rgba(244,189,79,.14);box-shadow:inset 0 1px 0 rgba(255,255,255,.08);text-align:center}

.event-date strong {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.event-date span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.event-row .event-date {
  border-top: 3px solid var(--kind, var(--gold));
  background: rgba(244, 189, 79, 0.14);
  background: color-mix(in srgb, var(--kind, var(--gold)) 15%, transparent);
}

.event-description {
  min-width: 0;
}

.event-description .eyebrow {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--kind, var(--gold-grad));
  color: var(--kind-ink, var(--ink));
  font-size: 0.62rem;
}

.event-description h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
}

.event-description h3 a {
  color: var(--text);
  text-decoration: none;
}

.event-description p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.event-description .badge {
  margin-top: 8px;
}

.event-row .row-end {
  grid-column: 1 / -1;
  justify-content: space-between;
}

.event-row .row-end .button {
  min-height: 42px;
}

.event-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
  margin: 14px 0 8px;
}

.event-summary p {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.event-summary strong {
  color: var(--text);
  font-size: 0.95rem;
}

.event-summary p:nth-child(n+3) strong {
  color: var(--gold-soft);
}

.my-registration {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.my-registration-type {
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--kind, var(--gold-grad));
  color: var(--kind-ink, var(--ink));
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.player-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
}

.application-review-card,
.session-history-card {
  background: var(--surface);
}

.roster-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--muted);
}

.feedback-note {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.event-registrations,
.event-informational-hint {
  margin: 0;
}

@media (min-width: 640px) {
  .event-row,
  .event-group .event-row {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
  }

  .event-row .row-end {
    grid-column: auto;
    flex-direction: column;
    align-items: flex-end;
  }
}

@media (min-width: 1100px) {
  .events-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

/* ---------- Event management ---------- */

.manage-actions {
  align-items: flex-start;
}

.more-actions {
  position: relative;
}

.more-actions summary {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  box-shadow: var(--shadow-sm);
}

.more-actions summary::-webkit-details-marker {
  display: none;
}

.more-actions summary .icon {
  margin-left: 8px;
}

.more-actions[open] > .actions {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.manage-instructions {
  margin: 0 0 18px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.manage-instructions summary,
.published-list summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  font-weight: 800;
  cursor: pointer;
}

.manage-instructions[open] {
  padding-bottom: 14px;
}

.manage-tabs {
  max-width: 420px;
  margin-top: 8px;
}

.manage-title {
  margin: 22px 0 12px;
}

.manage-filters {
  margin: 0 0 12px;
}

.application-body {
  padding: 14px 16px 16px;
}

.application-body form {
  margin-top: 12px;
}

.roster-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(244, 189, 79, 0.12);
  color: var(--gold-soft);
  box-shadow: var(--shadow-sm);
}

.roster-status.published {
  background: var(--green-bg);
  color: var(--green);
}

.roster-status span {
  font-weight: 700;
}

.published-list {
  margin: 0 0 18px;
  padding: 0 16px 6px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Lineup picker colours (desktop and Android; iOS relies on the 🟢/⚪ markers). */
.application-row.has-shot {
  box-shadow:
    var(--shadow-sm),
    inset 4px 0 0 var(--green);
}

.application-row.has-shot .request-row-name small {
  color: var(--green);
  font-weight: 700;
}

select option.pick-shot {
  color: var(--green);
  font-weight: 700;
}

select option.pick-applied {
  color: var(--gold-soft);
}

select option.pick-other {
  color: var(--faint);
}

.picker-legend {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Lineup editor: on phones each table row becomes a small card. */
@media (max-width: 719px) {
  .lineup-panel .table-wrap {
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .lineup-panel thead {
    display: none;
  }

  .lineup-panel table,
  .lineup-panel tbody {
    display: block;
  }

  /* Row 1: number + player; row 2: points limit and message side by side. */
  .lineup-panel tr {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 8px;
    margin: 0 0 8px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    box-shadow: var(--shadow-sm);
  }

  .lineup-panel td {
    padding: 0;
    border: 0;
  }

  .lineup-panel td:first-child {
    grid-row: span 2;
    padding-top: 12px;
    font-weight: 800;
    color: var(--gold-soft);
  }

  .lineup-panel td:nth-child(2) {
    grid-column: 2 / 4;
  }

  .lineup-panel td label {
    gap: 3px;
    font-size: 0.64rem;
    white-space: nowrap;
  }

  .lineup-panel td input,
  .lineup-panel td select {
    min-height: 42px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .event-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .event-summary:has(p:nth-child(4)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-summary p {
    padding: 10px;
    font-size: 0.66rem;
  }

  .event-summary strong {
    font-size: 0.8rem;
  }
}

/* Save and publish stay reachable while scrolling a long lineup. */
.lineup-panel form > .actions {
  position: sticky;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 5;
  margin: 12px 0 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(25, 34, 63, 0.95);
  box-shadow: var(--shadow-lg);
  flex-wrap: nowrap;
}

.lineup-panel form > .actions button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 10px;
}

@media (min-width: 1024px) {
  .lineup-panel form > .actions {
    bottom: 16px;
  }
}

/* ---------- Profile pictures ---------- */

.avatar {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  overflow: hidden;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(244, 189, 79, 0.35);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 1.3rem;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 2.4rem;
  box-shadow: 0 0 0 3px rgba(244, 189, 79, 0.45), var(--shadow);
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

/* Top bar: small round picture and the governor name, a shortcut to Profile. */
.masthead-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 190px;
  height: 44px;
  padding: 0 12px 0 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.masthead-profile:hover {
  color: var(--gold-soft);
}

.masthead-name {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 559.98px) {
  .masthead-profile {
    max-width: 112px;
    padding-right: 10px;
  }

  .masthead-name {
    font-size: 0.74rem;
  }

  /* Players have no view switch: the name can take that room. */
  .masthead-tools:not(:has(.view-switch)) .masthead-profile {
    max-width: 180px;
  }
}

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
}

.avatar-picker-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.avatar-picker-body small {
  color: var(--muted);
}

.avatar-picker-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.avatar-upload {
  position: relative;
  overflow: hidden;
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.85rem;
  cursor: pointer;
}

.avatar-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-upload:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.request-avatar-panel .avatar-picker {
  margin: 6px 0 0;
}

.request-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.request-row summary .request-row-name {
  flex: 1;
}

@media (max-width: 379.98px) {
  .masthead-name {
    display: none;
  }

  .masthead-profile {
    padding: 0 7px;
  }
}

/* ---------- Notifications ---------- */

.notification-intro {
  margin: 0 0 16px;
  color: var(--muted);
}

.notification-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  opacity: 0.85;
  box-shadow: var(--shadow-sm);
}

.notification.unread {
  background: var(--hero-grad);
  opacity: 1;
  box-shadow: var(--shadow);
}

.notification h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.notification h3 a {
  color: var(--text);
  text-decoration: none;
}

.notification p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Notifications page: compact rows, an icon per kind, grouped by day. */
.notif-day {
  margin: 14px 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notif-day:first-child {
  margin-top: 0;
}

.notif-filters {
  margin-bottom: 14px;
}

.notif-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.notif-item.unread {
  background: var(--hero-grad);
  box-shadow: var(--shadow);
}

.notif-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--notif-color, var(--muted));
}

.notif-icon svg {
  width: 18px;
  height: 18px;
}

.notif-item.announcements {
  --notif-color: var(--gold);
}

.notif-item.events {
  --notif-color: var(--kind-ark);
}

.notif-item.requests {
  --notif-color: var(--kind-alliance_mobilization);
}

.notif-item.messages {
  --notif-color: var(--kind-other);
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-top h3 {
  flex: 1;
  min-width: 0;
}

.notif-item.unread .notif-top h3 a::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 7px 2px 0;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: middle;
}

.notif-item .notif-check {
  flex: none;
  width: 30px;
  min-height: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--gold-soft);
  font-size: 0.85rem;
  box-shadow: none;
}

.notif-item .notif-check:hover {
  background: var(--gold-grad);
  color: var(--ink);
  box-shadow: none;
}

.notif-top h3 {
  margin: 0;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.notif-top h3 a {
  color: var(--text);
  text-decoration: none;
}

.notif-top small {
  flex: none;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
}

.notif-body p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.notif-body .text-button,
.notif-body button {
  min-height: 32px;
  margin-top: 8px;
  padding: 0;
  font-size: 0.8rem;
}

.notif-body button.secondary {
  padding: 6px 12px;
}

.notification-feed + .secondary,
.notification-feed + button {
  margin-top: 14px;
}

.notification-feed ~ .notification-intro {
  margin: 18px 0 0;
  font-size: 0.8rem;
}

.confirmed {
  color: var(--green);
  font-weight: 700;
}

/* ---------- KVK ---------- */

.section-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  max-width: 460px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 18px;
  background: var(--inset);
  box-shadow: var(--inset-shadow);
}

.section-tabs a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}

.section-tabs a.active {
  background: var(--gold-grad);
  color: var(--ink);
  box-shadow: 0 6px 16px var(--glow);
}

.scan-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.scan-info strong {
  color: var(--text-soft);
}

.kvk-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.kvk-summary > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--hero-grad);
  box-shadow: var(--shadow);
}

.kvk-summary span {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.kvk-summary strong {
  font-size: 1.05rem;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.kvk-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 14px;
}

.results-count {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.kvk-table-head {
  display: none;
}

.governor-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.governor-card{display:grid;grid-template-columns:30px minmax(0,1fr) auto!important;gap:12px;align-items:center;padding:16px 14px;border-radius:22px;background:var(--surface);color:var(--text);text-decoration:none;box-shadow:var(--shadow);transition:transform .15s ease}

.governor-card:hover {
  color: var(--text);
}

.governor-rank {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted);
}

.governor-list > .governor-card:nth-child(-n + 3) .governor-rank {
  color: var(--gold-soft);
}

.governor-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.governor-name > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.governor-name strong {
  overflow: hidden;
  font-size: 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.governor-name small {
  font-variant-numeric: tabular-nums;
}

.governor-medallion {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--inset);
  color: var(--gold-soft);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow:
    0 0 0 2px var(--gold-b),
    0 0 14px var(--glow);
}

.detail-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gold-soft);
  white-space: nowrap;
}

.kvk-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kvk-metric {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 10px 11px 11px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.kvk-metric span {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--muted);
}

.kvk-metric strong {
  align-self: flex-start;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--green);
  background: var(--green-bg);
  box-shadow: inset 0 0 0 1px rgba(63, 216, 154, 0.28);
}

.kvk-metric small {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

/* Power is a loss unless it grew; deaths are always a loss; DKP is blue. */
.kvk-metric.power strong,
.kvk-metric.deaths strong {
  color: var(--red);
  background: var(--red-bg);
  box-shadow: inset 0 0 0 1px rgba(229, 72, 77, 0.32);
}

.kvk-metric.power.power-up strong {
  color: var(--green);
  background: var(--green-bg);
  box-shadow: inset 0 0 0 1px rgba(63, 216, 154, 0.28);
}

.kvk-metric.dkp {
  grid-column: 1 / -1;
}

.kvk-metric.dkp strong {
  color: var(--blue);
  background: var(--blue-bg);
  box-shadow: inset 0 0 0 1px rgba(110, 135, 255, 0.36);
}

.kvk-detail-metrics {
  margin: 0 0 18px;
}

.kvk-detail-metrics .kvk-metric {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.governor-profile {
  margin: 0 0 18px;
  padding: 20px;
  border-radius: 24px;
  background: var(--hero-grad);
  box-shadow: var(--shadow-lg);
}

.governor-profile h2 {
  font-family: var(--display);
  font-size: 1.5rem;
}

.target-progress label {
  color: var(--text-soft);
}

progress {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  appearance: none;
}

progress::-webkit-progress-bar {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: var(--gold-grad);
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: var(--gold-grad);
  border-radius: 999px;
}

.preview-personal {
  margin: 0 0 14px;
}

@media (min-width: 720px) {
  .kvk-controls {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

  .kvk-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .kvk-metric.dkp {
    grid-column: auto;
  }
}

@media (min-width: 1500px) {
  .kvk-metrics {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

/* ---------- Onboarding and requests ---------- */

.onboarding-hero,
.request-hero,
.support-hero,
.guides-intro {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 22px;
  border-radius: 24px;
  background: var(--hero-grad);
  box-shadow: var(--shadow-lg);
}

.onboarding-hero p,
.request-hero p,
.support-hero p,
.guides-intro p {
  margin: 0;
  max-width: 600px;
  color: var(--text-soft);
}

.onboarding-hero h1,
.request-hero h1,
.support-hero h1,
.guides-intro h1 {
  margin: 0 0 6px;
}

/* Illustrated scenes behind the section headers (images in /assets/platform/scenes/headers, cropped 3:1 from the
   originals in brand/platform/immagini): the scene fills the whole box, darkened on the left under the text;
   on phones it sits above the text. Home and Events keep their own pictures. */
:is(.onboarding-hero, .request-hero, .support-hero, .events-heading, main[data-route=ark] .ark-player > .ark-head, main[data-route=kvk] .page-heading, main[data-route=guides] .guides-intro, main[data-route=announcements] .page-heading, main[data-route=notifications] .page-heading, main[data-route=profile] .page-heading, main[data-route=admin] .page-heading) {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-end;
  gap: 12px;
  aspect-ratio: 3 / 1;
  margin: 0 0 18px;
  padding: 22px;
  border-radius: 24px;
  background: #0a0e1c;
  box-shadow: var(--shadow-lg);
}

:is(.onboarding-hero, .request-hero, .support-hero, .events-heading, main[data-route=ark] .ark-player > .ark-head, main[data-route=kvk] .page-heading, main[data-route=guides] .guides-intro, main[data-route=announcements] .page-heading, main[data-route=notifications] .page-heading, main[data-route=profile] .page-heading, main[data-route=admin] .page-heading)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 14, 28, 0.92) 0, rgba(10, 14, 28, 0.6) 32%, rgba(10, 14, 28, 0) 58%), var(--scene) right center / cover no-repeat;
}

:is(.onboarding-hero, .request-hero, .support-hero, .events-heading, main[data-route=ark] .ark-player > .ark-head, main[data-route=kvk] .page-heading, main[data-route=guides] .guides-intro, main[data-route=announcements] .page-heading, main[data-route=notifications] .page-heading, main[data-route=profile] .page-heading, main[data-route=admin] .page-heading) > * {
  position: relative;
  max-width: min(520px, 58%);
}

.onboarding-hero { --scene: url(/assets/platform/scenes/headers/onboarding.webp); }
.request-hero { --scene: url(/assets/platform/scenes/headers/request.webp); }
.support-hero { --scene: url(/assets/platform/scenes/headers/help.webp); }
.events-heading { --scene: url(/assets/platform/scenes/headers/request.webp); }
main[data-route=ark] { --scene: url(/assets/platform/scenes/headers/ark.webp); }
main[data-route=kvk] { --scene: url(/assets/platform/scenes/headers/kvk.webp); }
main[data-route=guides] { --scene: url(/assets/platform/scenes/headers/guides.webp); }
main[data-route=announcements] { --scene: url(/assets/platform/scenes/headers/announcements.webp); }
main[data-route=notifications] { --scene: url(/assets/platform/scenes/headers/notifications.webp); }
main[data-route=profile] { --scene: url(/assets/platform/scenes/headers/profile.webp); }
main[data-route=admin] { --scene: url(/assets/platform/scenes/headers/admin.webp); }

.request-hero .request-checklist div {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 700px) {
  :is(.onboarding-hero, .request-hero, .support-hero, .events-heading, main[data-route=ark] .ark-player > .ark-head, main[data-route=kvk] .page-heading, main[data-route=guides] .guides-intro, main[data-route=announcements] .page-heading, main[data-route=notifications] .page-heading, main[data-route=profile] .page-heading, main[data-route=admin] .page-heading) {
    aspect-ratio: auto;
    padding-top: 200px;
  }

  :is(.onboarding-hero, .request-hero, .support-hero, .events-heading, main[data-route=ark] .ark-player > .ark-head, main[data-route=kvk] .page-heading, main[data-route=guides] .guides-intro, main[data-route=announcements] .page-heading, main[data-route=notifications] .page-heading, main[data-route=profile] .page-heading, main[data-route=admin] .page-heading)::before {
    bottom: auto;
    height: 260px;
    background: var(--scene) 80% center / cover no-repeat;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 150px, transparent 250px);
    mask-image: linear-gradient(180deg, #000 0, #000 150px, transparent 250px);
  }

  :is(.onboarding-hero, .request-hero, .support-hero, .events-heading, main[data-route=ark] .ark-player > .ark-head, main[data-route=kvk] .page-heading, main[data-route=guides] .guides-intro, main[data-route=announcements] .page-heading, main[data-route=notifications] .page-heading, main[data-route=profile] .page-heading, main[data-route=admin] .page-heading) > * {
    max-width: none;
  }
}

.onboarding-choice-heading {
  margin: 0 0 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
}

.onboarding-choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1.5px solid transparent;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    transform 0.15s ease,
    border-color 0.2s ease;
}

.onboarding-choice:hover {
  border-color: var(--gold-b);
  color: var(--text);
  background: var(--hero-grad);
}

.onboarding-choice h2 {
  margin: 0 0 4px;
}

.onboarding-choice p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.event-monogram {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 16px;
  background: var(--gold-grad);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 18px var(--glow);
}

.choice-arrow {
  margin-left: auto;
  color: var(--gold-soft);
  font-size: 1.2rem;
  font-weight: 800;
}

.request-checklist {
  display: grid;
  gap: 8px;
  width: 100%;
}

.request-checklist div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.request-checklist span {
  font-weight: 800;
  color: var(--gold-soft);
}

.request-checklist p {
  margin: 0;
  font-size: 0.88rem;
}

.request-form-intro {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.request-form-intro p:last-child {
  margin: 0;
  color: var(--muted);
}

.request-history-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.request-history-result strong {
  color: var(--gold-soft);
}

.admin-request-group {
  margin: 18px 0;
}

/* ---------- Uploads and media ---------- */

.uploader {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1.5px dashed var(--gold-b);
  background: rgba(244, 189, 79, 0.04);
}

.uploader > label {
  color: var(--gold-soft);
}

.uploader input[type="file"] {
  min-height: 48px;
  padding: 10px;
  background: var(--inset);
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--gold-grad);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.uploader.attack-upload {
  border-color: var(--red);
  background: rgba(229, 72, 77, 0.07);
}

.uploader.attack-upload > label {
  color: var(--red);
}

.uploader > label {
  position: relative;
}

.uploader > label input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: var(--gold-grad);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--glow);
}

.uploader > label:focus-within .upload-button {
  outline: 2px solid var(--gold-a);
  outline-offset: 3px;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.upload-required {
  color: var(--gold-soft);
  font-weight: 700;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 110px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--gold-soft);
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.upload-dropzone:hover {
  background: var(--surface-2);
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.request-uploader {
  border-style: solid;
  border-color: var(--line-strong);
}

.request-upload-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.request-upload-heading > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.screenshot-example {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

.screenshot-example small {
  color: var(--muted);
}

.screenshot-example-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr);
  gap: 10px;
  align-items: start;
  max-width: 620px;
  margin-top: 6px;
}

.screenshot-example-shot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  text-decoration: none;
}

.screenshot-example-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.media a,
.media button {
  display: block;
  padding: 0;
  min-height: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}

.media img,
.media span {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.private-file-loading {
  opacity: 0.6;
}

.pdf {
  font-weight: 800;
  color: var(--gold-soft);
}

/* ---------- Help, tickets, conversations ---------- */

.attack-callout{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px;padding:18px 20px;border-radius:22px;background:linear-gradient(135deg,rgba(229,72,77,.22),rgba(229,72,77,.05)),var(--surface);box-shadow:var(--shadow),inset 0 0 0 1px rgba(229,72,77,.4)}
.attack-callout>div{flex:1 1 260px;min-width:0}
.attack-callout .eyebrow{color:var(--red)}
.attack-callout h2{margin:2px 0 6px;font-family:var(--display);font-size:1.3rem}
.attack-callout p{margin:0;color:var(--text-soft)}
.attack-callout button{flex:0 0 auto;min-height:46px;background:linear-gradient(135deg,#ff7a7f,#d13f45);color:#fff;box-shadow:0 8px 20px rgba(229,72,77,.35)}

.support-compose {
  margin: 0 0 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ticket-history {
  margin: 0 0 18px;
}

.ticket-history-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ticket-history-main {
  min-width: 0;
  flex: 1 1 260px;
}

.ticket-history-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}

.ticket-history-main h3 {
  margin: 0 0 4px;
}

.ticket-history-main h3 a {
  color: var(--text);
  text-decoration: none;
}

.ticket-history-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.ticket-history-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.ticket-card-actions,
.ticket-done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ticket-done-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.ticket-card-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.tl-archived .tl-dot { background: var(--muted); }
.tl-unarchived .tl-dot { background: #46d39a; }

.ticket-history-meta .ticket-close {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
}

/* Ticket statuses: each one its own colour. */
.badge.ticket-status.open { background: rgba(70, 211, 154, 0.14); color: #46d39a; }
.badge.ticket-status.in_progress { background: rgba(92, 200, 255, 0.14); color: #5cc8ff; }
.badge.ticket-status.waiting_player { background: rgba(244, 189, 79, 0.16); color: var(--gold-soft); }
.badge.ticket-status.resolved { background: rgba(180, 140, 255, 0.16); color: #b48cff; }
.badge.ticket-status.closed { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

.ticket-archive-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Staff controls of a ticket: assignee and status side by side. */
.ticket-manage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.ticket-manage form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ticket-manage form button[type="submit"] {
  min-height: 46px;
  padding: 0 16px;
}

.ticket-manage form .form-error {
  grid-column: 1 / -1;
}

.ticket-timeline {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ticket-timeline summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  cursor: pointer;
}

.ticket-timeline summary span {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
}

.ticket-timeline ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.ticket-timeline li {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 12px;
}

.ticket-timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 5px;
  width: 2px;
  background: var(--line-strong);
}

.tl-dot {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.tl-assigned .tl-dot { background: #5cc8ff; }
.tl-status .tl-dot { background: #b48cff; }
.tl-status.tl-closed .tl-dot { background: #ff6b6b; }
.tl-status.tl-open .tl-dot { background: #46d39a; }

.ticket-timeline p {
  margin: 0;
  font-size: 0.88rem;
}

.ticket-timeline small {
  color: var(--faint);
  font-size: 0.74rem;
}

.ticket-category {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--gold-grad);
  color: var(--ink);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.conversation,
.conversation-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

/* Reply box of a ticket: Close next to Send, Send takes the rest of the row. */
.ticket-reply-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.ticket-reply-actions > button.secondary,
.ticket-reply-actions > button.ticket-close {
  flex: none;
}

/* Closing a ticket is the one red action: black text on red. */
button.ticket-close {
  background: #ff6b6b;
  color: #000;
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

button.ticket-close:hover {
  background: #ff8080;
  color: #000;
  box-shadow: 0 10px 26px rgba(255, 107, 107, 0.4);
}

.ticket-reply-actions > button[type="submit"] {
  flex: 1;
}

.message,
.conversation-message {
  align-self: flex-start;
  max-width: min(84%, 620px);
  padding: 12px 14px;
  border-radius: 20px 20px 20px 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.message.mine,
.conversation-message.own {
  align-self: flex-end;
  border-radius: 20px 20px 6px 20px;
  background: linear-gradient(135deg, rgba(255, 211, 110, 0.95), rgba(229, 154, 47, 0.95));
  color: var(--ink);
  box-shadow: 0 8px 20px var(--glow);
}

.message.mine small,
.message.mine strong,
.conversation-message.own small,
.conversation-message.own strong {
  color: rgba(29, 19, 5, 0.75);
}

.message .section-heading {
  margin: 0 0 4px;
  font-size: 0.8rem;
}

.message p,
.conversation-message p {
  margin: 4px 0;
}

.conversation-panel form {
  padding: 12px;
  border-radius: 20px;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}

/* ---------- Announcements and guides ---------- */

.announcement-list > article:first-child:not(.announcement-card) {
  background: var(--hero-grad);
}

.guides-intro {
  align-items: center;
}

.guide-search {
  margin: 0 0 18px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.guide-card:hover {
  color: var(--text);
}

.guide-card-image {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--hero-grad);
}

.guide-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.guide-card:hover .guide-card-image img {
  transform: scale(1.06);
}

.guide-card-placeholder {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 2.4rem;
  color: var(--gold-soft);
}

.guide-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
}

.guide-card-content h2 {
  margin: 0;
  font-size: 1.02rem;
}

.guide-card-content p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.guide-card-link {
  margin-top: 6px;
  color: var(--gold-soft);
  font-size: 0.85rem;
  font-weight: 800;
}

.guide-detail-head {
  margin: 0 0 16px;
}

.guide-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.guide-kicker {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--gold-grad);
  color: var(--ink);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guide-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.guide-media img,
.guide-inline-media img {
  display: block;
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.guide-body {
  max-width: 760px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text-soft);
}

.guide-body h2,
.guide-body h3 {
  color: var(--gold-soft);
}

/* ---------- Menu, profile, admin ---------- */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.menu-tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 96px;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.menu-tile:hover {
  color: var(--gold-soft);
}

.menu-tile .nav-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.email-preferences p {
  color: var(--muted);
}

.admin-request-card h3 {
  margin: 0;
}

.permission-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.permission-user-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.audit-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.88rem;
}

/* ---------- Dialog, media viewer, toast, tour ---------- */

dialog {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100dvh - 40px);
  padding: 20px;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(3, 5, 12, 0.72);
  backdrop-filter: blur(4px);
}

dialog > .section-heading {
  margin: 0 0 14px;
}

dialog > .section-heading h2 {
  font-family: var(--display);
  font-size: 1.3rem;
}

dialog.media-viewer {
  width: min(1100px, calc(100% - 16px));
  padding: 12px;
}

.media-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.media-viewer-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.media-viewer-actions button.secondary {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.media-viewer-head h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.media-viewer-body {
  display: grid;
  place-items: center;
}

.media-viewer-save {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
}

/* Phones cannot scroll a PDF inside a frame: a card with the share button. */
.media-viewer-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  padding: 28px 18px;
  text-align: center;
}

.media-viewer-pdf .pdf {
  display: grid;
  place-items: center;
  width: 72px;
  height: 88px;
  border-radius: 12px;
  background: var(--kind-barbarians);
  color: var(--kind-barbarians-ink);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.media-viewer-pdf strong {
  overflow-wrap: anywhere;
}

.media-viewer-pdf p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.media-viewer-image {
  max-width: 100%;
  max-height: calc(100dvh - 210px);
  border-radius: 14px;
  object-fit: contain;
}

.media-viewer-frame {
  width: 100%;
  height: calc(100dvh - 140px);
  border: 0;
  border-radius: 14px;
  background: #fff;
}

#toast {
  position: fixed;
  z-index: 1500;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transition:
    opacity 0.25s ease,
    transform 0.25s var(--ease);
}

#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tour-block {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

/* The lit target: a box over it (kept inside the screen) whose huge shadow dims the rest of the page,
   with a thick pulsing gold ring and a light tint so the eye goes straight to it. */
.tour-spot {
  position: fixed;
  z-index: 1001;
  border-radius: 14px;
  pointer-events: none;
  background: rgba(255, 211, 110, 0.1);
  box-shadow:
    0 0 0 9999px rgba(3, 5, 12, 0.82),
    inset 0 0 0 3px var(--gold-a),
    0 0 0 3px rgba(255, 211, 110, 0.35),
    0 0 30px 6px var(--gold-a);
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
  animation: tourFade 0.18s ease-out, tourPulse 1.6s ease-in-out 0.2s infinite;
}

@keyframes tourPulse {
  50% {
    box-shadow:
      0 0 0 9999px rgba(3, 5, 12, 0.82),
      inset 0 0 0 3px var(--gold-a),
      0 0 0 8px rgba(255, 211, 110, 0.18),
      0 0 44px 12px var(--gold-a);
  }
}

.tour-spot.full {
  inset: 0;
  border-radius: 0;
  background: rgba(3, 5, 12, 0.72);
  box-shadow: none;
}

.tour-card {
  position: fixed;
  z-index: 1003;
  left: 16px;
  right: 16px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  max-width: 400px;
  margin-left: auto;
  padding: 22px;
  border-radius: 24px;
  background: var(--hero-grad);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: tourSlide 0.22s ease-out;
}

.tour-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tour-kicker {
  color: var(--gold-soft);
  font-weight: 800;
}

.tour-card h2 {
  margin: 14px 0 8px;
  font-family: var(--display);
  font-size: 1.4rem;
}

.tour-card p {
  margin: 0;
  color: var(--text-soft);
}

.tour-card.top {
  top: calc(16px + env(safe-area-inset-top));
  bottom: auto;
}

@media (max-width: 720px) {
  .tour-card {
    padding: 16px 18px;
  }

  .tour-card h2 {
    margin: 10px 0 6px;
    font-size: 1.2rem;
  }

  .tour-actions {
    margin-top: 12px;
  }
}

.tour-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.tour-actions span:first-child {
  margin-right: auto;
}

@media (min-width: 1024px) {
  .tour-card {
    bottom: 28px;
    right: 28px;
  }

  .tour-card.top {
    top: 28px;
    bottom: auto;
  }

  #toast {
    bottom: 28px;
  }
}

/* ---------- Mobile guardrails ---------- */

@media(max-width:720px){html,body{max-width:100%;overflow-x:clip}
  .page-heading {
    align-items: flex-start;
  }

  .row-end {
    justify-content: flex-start;
  }

  .ticket-history-meta {
    align-items: flex-start;
  }

  /* Governors and DKP side by side, total power on its own full row. */
  .kvk-summary {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }

  .kvk-summary > div:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .kvk-summary strong {
    white-space: nowrap;
  }

  .next-event-dates {
    grid-template-columns: minmax(0, 1fr);
  }

  .media img,
  .media span {
    width: 84px;
    height: 84px;
  }
}

/* ---------- Reduced motion ---------- */

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

/* Session opened from a link the browser did not start: confirm the account. */
.link-confirm .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Royal icon set (Lucide shapes). Containers that size their svg keep priority. */
.icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
}

.icon-fill {
  fill: currentColor;
  fill-opacity: 0.16;
  stroke: none;
}

.mobile-dock a.active .icon-fill,
.main-navigation a.active .icon-fill {
  fill-opacity: 0.24;
}

small .icon-fill,
.notif-check .icon-fill {
  fill-opacity: 0;
}

.notif-item .notif-check .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.25;
}

.back-link .icon {
  margin-right: 6px;
}

.choice-arrow .icon,
.language-arrow .icon {
  display: block;
}

.shot-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  vertical-align: 1px;
}

.shot-dot.on {
  border-color: var(--green);
  background: var(--green);
}

/* Home: open MGE/Ark applications, one card each. */
.open-applications {
  margin: 0 0 18px;
}

.open-applications h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.open-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.next-event.open-app {
  margin: 0;
  transition: none;
}

.next-event.open-app.todo {
  box-shadow: 0 0 0 1.5px var(--gold), var(--shadow-lg);
}

.open-app-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.open-app-status small {
  color: var(--muted);
  font-size: 0.8rem;
}

.badge.not-applied {
  background: rgba(244, 189, 79, 0.16);
  color: var(--gold-soft);
}

.open-app .button {
  align-self: flex-start;
  min-height: 44px;
}

.mobile-dock a {
  position: relative;
}

.dock-dot {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-deep);
}

.mobile-dock a.active .dock-dot {
  background: var(--ink);
  color: var(--gold-a);
}

/* KVK: profile pictures in the governor medallion. */
.governor-medallion {
  overflow: hidden;
}

.governor-medallion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.governor-profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.governor-profile-head .governor-medallion {
  width: 56px;
  height: 56px;
  font-size: 1.3rem;
}

.governor-profile-head h2 {
  margin: 0;
}

/* Profile: password and account deletion. */
.danger-zone {
  box-shadow: 0 0 0 1px rgba(229, 72, 77, 0.35), var(--shadow);
}

.danger-zone button[type="submit"] {
  background: var(--red-strong);
  color: #fff;
}

/* Brand intro (web/brand-intro.js): crest, "ammon." and "KINGDOM 1141". */
.brand-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 auto 6px;
}

.brand-crest {
  position: relative;
  width: 210px;
  height: 210px;
  margin: -24px 0 -30px;
}

/* Transparent still (web/brand-intro.js swaps in the WebGL clip while it plays). */
.brand-crest-still,
.brand-crest-clip {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-crest-still[hidden] {
  display: none;
}

.brand-animating .brand-crest,
.brand-animating ~ [data-brand-after] {
  opacity: 0;
}

.brand-word {
  position: relative;
  width: 100%;
  height: 92px;
  pointer-events: none;
}

.brand-word-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1400px;
  height: 240px;
  margin: -120px 0 0 -700px;
  transform: scale(0.24);
  color: var(--gold);
}

.brand-signs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.brand-glyph {
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.brand-glyph svg {
  overflow: visible;
  fill: none;
}

.brand-bounced {
  transform-origin: 50% 100% 0;
  transform: translateY(200px) scaleX(0.55) scaleY(0.8);
}

.brand-static .brand-bounced {
  transform: scaleY(0.6);
}

.brand-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 40;
  stroke-linecap: square;
  filter: drop-shadow(0 0 12px rgba(244, 189, 79, 0.35));
}

.brand-bounce {
  position: absolute;
  bottom: 0;
  left: 60px;
  width: 1400px;
  height: 260px;
}

.brand-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  opacity: 0.001;
  background: linear-gradient(135deg, var(--gold-a), var(--gold-b));
  box-shadow: 0 0 24px rgba(255, 211, 110, 0.6);
}

.brand-sub {
  width: min(62%, 250px);
  height: auto;
  overflow: visible;
}

.brand-sub-line {
  fill: url(#brand-sub-gold);
  fill-opacity: 0;
  stroke: var(--gold);
  stroke-linejoin: round;
}

.brand-static .brand-sub-line {
  fill-opacity: 1;
}

.entry-langs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.entry-lang {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--faint);
  font-size: 0.85rem;
  font-weight: 700;
}

.entry-lang[aria-current="true"] {
  background: rgba(244, 189, 79, 0.1);
  color: var(--gold);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* "Name is typing" in request chats and tickets (web/app.js typingBox). */
.typing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 2px 4px;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
}

.typing[hidden] {
  display: none;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(244, 189, 79, 0.12);
}

.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* With reduced motion the dots still pulse, without jumping (the global rule above stops
   every other animation, hence !important here). */
@media (prefers-reduced-motion: reduce) {
  .typing-dots i { animation: typing-pulse 1.2s ease-in-out infinite !important; }
  .typing-dots i:nth-child(2) { animation-delay: 0.15s !important; }
  .typing-dots i:nth-child(3) { animation-delay: 0.3s !important; }
  @keyframes typing-pulse {
    0%, 60%, 100% { opacity: 0.35; }
    30% { opacity: 1; }
  }
}

/* Touch screens: text links and small buttons get a hit area of about 44 px without
   moving anything (vertical padding on an inline link does not change the line). */
@media (pointer: coarse) {
  .text-link,
  .notification h3 a,
  .notif-top h3 a,
  .event-description h3 a {
    padding-block: 11px;
  }
  .notif-item .notif-check {
    position: relative;
  }
  .notif-item .notif-check::after {
    content: "";
    position: absolute;
    inset: -7px;
  }
}

/* Event filters scroll sideways on narrow screens: a fade on the right edge shows there
   is more, and the spacer lets the last filter scroll clear of the fade. */
@media (max-width: 719px) {
  .event-filters {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  }
  .event-filters::after {
    content: "";
    flex: 0 0 24px;
  }
}

/* Cards with an "Open" link (events, tickets, open applications) open from anywhere:
   app.js follows the card's own link on a click outside its links and buttons. */
.event-row,
.ticket-history-card,
.open-app {
  cursor: pointer;
}

/* Phones: the date of a notification goes under its title, so the title keeps the width. */
@media (max-width: 559.98px) {
  .notif-top {
    flex-wrap: wrap;
  }
  .notif-top small {
    order: 3;
    flex-basis: 100%;
    margin-top: -4px;
  }
}

/* ---------- Language menu ---------- */
.lang-menu {
  position: relative;
}

.lang-menu[open] {
  z-index: 60;
}

.lang-menu > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lang-menu > summary::-webkit-details-marker {
  display: none;
}

.lang-menu > summary:hover,
.lang-menu > summary:focus-visible,
.lang-menu[open] > summary {
  border-color: var(--gold-b);
  box-shadow: var(--shadow-sm), 0 0 0 4px var(--glow);
  outline: none;
}

.lang-flag {
  display: block;
  width: 26px;
  height: 18px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.lang-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lang-caret {
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s;
}

.lang-menu[open] .lang-caret {
  transform: translateY(2px) rotate(-135deg);
}

.lang-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  animation: lang-list-in 0.16s ease-out;
}

.lang-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  text-align: left;
  box-shadow: none;
}

.lang-list button:hover,
.lang-list button:focus-visible {
  background: var(--inset);
  outline: none;
}

.lang-list button[aria-checked="true"] {
  background: var(--inset);
  color: var(--gold);
  font-weight: 700;
}

.lang-list .lang-name {
  flex: 1;
}

.lang-code {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lang-check {
  width: 14px;
}

.lang-list button[aria-checked="true"] .lang-check::after {
  content: "";
  display: block;
  width: 5px;
  height: 10px;
  margin-left: 4px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
}

/* The page heading animates in with a transform, which makes it its own layer:
   lift it above the tiles below while its menu is open. */
.page-heading:has(.lang-menu[open]) {
  position: relative;
  z-index: 60;
}

@keyframes lang-list-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lang-list { animation: none; }
  .lang-caret { transition: none; }
}

/* ---------- "Show more" buttons at the end of a list ---------- */
button.secondary[data-do$="-more"] {
  display: flex;
  width: fit-content;
  min-width: 220px;
  margin: 18px auto 4px;
  padding: 0 26px;
  border: 1.5px solid rgba(244, 189, 79, 0.45);
  border-radius: 999px;
  background: var(--surface);
  color: var(--gold);
  font-weight: 700;
}

button.secondary[data-do$="-more"]::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -3px 0 0 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

button.secondary[data-do$="-more"]:hover,
button.secondary[data-do$="-more"]:focus-visible {
  border-color: var(--gold-b);
  color: var(--gold);
  box-shadow: var(--shadow-sm), 0 0 0 4px var(--glow);
}

/* ---------------------------------------------------------------- Ark plan editor (web/js/ark/) */
.ark-slot { min-height: 60vh; }
.ark-editor { --team-a: #f4bd4f; --team-b: #5cc8ff; --team-ab: #c9a7ff; --team-r: #a3acc9; display: grid; gap: 14px; outline: none; }
.ark-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ark-head h1 { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.75rem); flex: 1 1 260px; }
.ark-head h1 span { color: var(--muted); font-weight: 600; }
.ark-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ark-head-tools button { min-height: 40px; }
.ark-status { padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; background: var(--inset); color: var(--muted); border: 1px solid var(--line); }
.ark-status.saved { color: var(--green); background: var(--green-bg); }
.ark-status.dirty, .ark-status.saving { color: var(--gold-soft); }
.ark-status.error, .ark-status.conflict { color: var(--red); background: var(--red-bg); }
.ark-version { color: var(--muted); font-size: 0.85rem; }
.ark-schematic { margin: 0; }
.ark-settings-box > summary { cursor: pointer; color: var(--gold-soft); font-weight: 700; padding: 4px 0; }
.ark-settings-box[open] > summary { margin-bottom: 8px; }
.ark-settings { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; }
.ark-field { display: grid; gap: 4px; font-size: 0.82rem; color: var(--muted); min-width: 110px; }
.ark-field select { padding-block: 6px; }
.ark-field select { min-height: 38px; }
.ark-field.check { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-soft); }
.ark-filters { display: contents; }
.ark-body { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr) minmax(240px, 320px); gap: 14px; align-items: start; }
.ark-roster, .ark-detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; max-height: 78vh; overflow: auto; }
.ark-roster h2, .ark-detail h2 { font-size: 0.95rem; margin: 10px 0 6px; }
.ark-roster h2:first-child { margin-top: 0; }
.ark-roster h2 small { color: var(--muted); font-weight: 600; }
.ark-roster ul, .ark-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ark-person { width: 100%; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "dot name meta" "dot squad meta"; align-items: center; gap: 0 8px; text-align: left; padding: 6px 8px; min-height: 44px; background: var(--inset); color: var(--text); border: 1px solid transparent; border-radius: 10px; box-shadow: none; font-weight: 600; }
.ark-person:hover { border-color: var(--line-strong); transform: none; }
.ark-person.selected, .ark-person[aria-pressed="true"] { border-color: var(--gold); background: var(--surface-2); color: var(--text); }
.ark-person.draft .ark-person-name { font-style: italic; }
.ark-person-name { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ark-squad { grid-area: squad; font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.ark-person-meta { grid-area: meta; font-size: 0.8rem; color: var(--muted); }
.ark-team-dot { grid-area: dot; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 800; color: var(--ink); }
.ark-team-dot.team-a { background: var(--team-a); }
.ark-team-dot.team-b { background: var(--team-b); }
.ark-team-dot.team-r { background: var(--team-r); }
.ark-stage { position: relative; min-width: 0; }
.ark-map { position: relative; width: min(100%, calc(76vh * var(--ark-fw, 2000) / var(--ark-fh, 1532))); margin-inline: auto; aspect-ratio: var(--ark-ratio, 2000 / 1532); border-radius: var(--radius-sm); overflow: hidden; background: #d2b282; border: 1px solid var(--line-strong); touch-action: none; user-select: none; }
.ark-svg { width: 100%; height: 100%; display: block; cursor: grab; }
.ark-svg:active { cursor: grabbing; }
.ark-zoom { position: absolute; right: 10px; bottom: 10px; display: grid; gap: 6px; }
.ark-zoom button { width: 40px; height: 40px; min-height: 40px; padding: 0; font-size: 1.2rem; }
.ark-building circle { fill: transparent; stroke: transparent; stroke-width: 6; }
.ark-building:hover circle { stroke: rgba(255, 255, 255, 0.55); }
.ark-building.selected circle { stroke: var(--gold-a); stroke-width: 8; }
.ark-building.estimated circle { stroke: rgba(29, 19, 5, 0.55); stroke-dasharray: 10 8; }
.ark-path { fill: none; stroke-width: 4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ark-zone { stroke-width: 2; vector-effect: non-scaling-stroke; fill-opacity: 0.18; }
.ark-item path { stroke: #1d1305; stroke-width: 2.5; }
.ark-item text, .ark-city text { font: 800 18px var(--sans); text-anchor: middle; fill: #1d1305; pointer-events: none; }
.ark-item.selected path { stroke: #fff; stroke-width: 4; }
.ark-item.missing path { stroke: var(--red-strong); stroke-width: 4; stroke-dasharray: 5 3; }
.ark-team-mark { font-size: 16px !important; paint-order: stroke; stroke: rgba(255, 255, 255, 0.85); stroke-width: 4px; }
.ark-city path { stroke: #1d1305; stroke-width: 1.5; }
.ark-city .ark-city-name { font-size: 13px; font-weight: 700; paint-order: stroke; stroke: rgba(255, 245, 225, 0.9); stroke-width: 4px; }
.ark-city.selected path { stroke: #fff; stroke-width: 3; }
.team-a.ark-item path, .team-a.ark-city path { fill: var(--team-a); }
.team-b.ark-item path, .team-b.ark-city path { fill: var(--team-b); }
.team-ab.ark-item path { fill: var(--team-ab); }
.team-r.ark-city path { fill: var(--team-r); }
.ark-zone.team-a { fill: var(--team-a); stroke: #b07a12; }
.ark-zone.team-b { fill: var(--team-b); stroke: #1f7fb0; }
.ark-zone.team-ab { fill: var(--team-ab); stroke: #7a54c4; }
.ark-editor[data-mode="edit"] .ark-city { cursor: move; }
.ark-card { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.ark-card p { margin: 0; }
.ark-card h2 { margin: 2px 0 4px; }
.ark-card h3 { font-size: 0.85rem; margin: 8px 0 2px; color: var(--muted); }
.ark-tag { color: var(--gold-soft); font-weight: 700; font-size: 0.85rem; }
.ark-kind { color: var(--muted); font-size: 0.82rem; }
.ark-hint { color: var(--muted); margin-top: 0; }
.ark-checks h2 { margin-top: 4px; }
.ark-check { margin: 0 0 6px; font-size: 0.88rem; padding-left: 10px; border-left: 3px solid var(--gold-b); }
.ark-check.error { border-color: var(--red-strong); }
details.ark-check summary { cursor: pointer; }
details.ark-check ul { margin: 4px 0 0; padding-left: 16px; color: var(--text-soft); }
.ark-check.error strong { color: var(--red); }
.ark-ok { color: var(--green); }
.ark-publish .actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1100px) {
  .ark-body { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); }
  .ark-roster { grid-column: 1 / -1; max-height: 260px; order: 3; }
}
@media (max-width: 720px) {
  .ark-body { grid-template-columns: minmax(0, 1fr); }
  .ark-roster, .ark-detail { max-height: none; }
  .ark-field { min-width: calc(50% - 8px); flex: 1 1 calc(50% - 8px); }
  .ark-map { width: min(100%, calc(68vh * var(--ark-fw, 2000) / var(--ark-fh, 1532))); }
}
@media (prefers-reduced-motion: reduce) {
  .ark-editor * { transition: none !important; animation: none !important; }
}
.ark-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ark-grid .ark-field { min-width: 0; }
.ark-edit input, .ark-edit textarea, .ark-edit select { width: 100%; }
.ark-assign { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ark-assign select { width: auto; min-height: 34px; padding-block: 4px; }
.ark-assign span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ark-add select { width: 100%; }
.ark-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ark-actions .ark-hint { flex-basis: 100%; margin: 0; }
.ark-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; padding: 6px 10px; border-radius: 999px; background: var(--gold-grad); color: var(--ink); font-weight: 800; box-shadow: var(--shadow); }
.ark-editor[data-mode="edit"] .ark-person { cursor: grab; }
.ark-stage { display: grid; gap: 8px; }
.ark-tools, .ark-phases { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ark-tools button, .ark-phases button { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
.ark-phases button[aria-pressed="false"] { background: var(--inset); color: var(--text-soft); box-shadow: none; border: 1px solid var(--line); }
.ark-phases button[aria-pressed="true"] { border: 1px solid var(--gold); }
.ark-play { width: 40px; padding: 0 !important; }
.ark-tools button[aria-pressed="true"].secondary { border-color: var(--gold); color: var(--gold-soft); }
.ark-tasks { display: none; }
.ark-tasks h2 { font-size: 0.95rem; margin: 10px 0 6px; }
.ark-tabs { display: none; }
.ark-coverage { pointer-events: none; }
.ark-ring-base { fill: none; stroke: rgba(29, 19, 5, 0.25); stroke-width: 7; }
.ark-ring { fill: none; stroke-width: 7; stroke-linecap: round; }
.ark-ring.team-a { stroke: #b07a12; }
.ark-ring.team-b { stroke: #1f7fb0; }
.ark-ring.team-ab { stroke: #7a54c4; }
.ark-uncovered circle { fill: var(--red-strong); stroke: #fff; stroke-width: 2.5; }
.ark-uncovered text { font: 900 20px var(--sans); fill: #fff; text-anchor: middle; }
.ark-march { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.ark-march.team-a { fill: var(--team-a); }
.ark-march.team-b { fill: var(--team-b); }
.ark-march.team-ab { fill: var(--team-ab); }
.ark-march.own { stroke: var(--red-strong); stroke-width: 3; }
.ark-svg .dim { opacity: 0.18; }
.ark-city.own path { stroke: var(--red-strong); stroke-width: 3; }
@media (max-width: 720px) {
  .ark-tabs { display: flex; gap: 6px; position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 6px 0; }
  .ark-tabs button { flex: 1; min-height: 42px; background: var(--inset); color: var(--text-soft); box-shadow: none; border: 1px solid var(--line); }
  .ark-tabs button[aria-selected="true"] { background: var(--gold-grad); color: var(--ink); border-color: transparent; }
  .ark-body[data-tab="map"] .ark-roster, .ark-body[data-tab="map"] .ark-tasks { display: none; }
  .ark-body[data-tab="team"] > :not(.ark-roster) { display: none; }
  .ark-body[data-tab="tasks"] > :not(.ark-tasks) { display: none; }
  .ark-body[data-tab="tasks"] .ark-tasks { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
  .ark-body[data-tab="map"] .ark-detail { position: relative; border-top: 3px solid var(--gold-b); }
  .ark-phases { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .ark-phases button { flex: 0 0 auto; }
}

/* Ark editor, simple layout (3d): the map takes the screen, one sentence says what the next tap does. */
.ark-editor { gap: 10px; }
.ark-head { gap: 8px 12px; }
.ark-head h1 { font-size: clamp(1.1rem, 1.8vw, 1.4rem); flex: 1 1 200px; }
.ark-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ark-steps li { flex: 1 1 180px; }
.ark-steps button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; text-align: left; font-weight: 700; }
.ark-steps button small { margin-left: auto; color: var(--muted); font-weight: 600; }
.ark-step-n { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; background: var(--inset); color: var(--gold-soft); border: 1px solid var(--gold-b); }
.ark-steps li.done .ark-step-n { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.ark-settings[hidden] { display: none; }
.ark-settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.ark-body { grid-template-columns: minmax(180px, 230px) minmax(0, 1fr) minmax(260px, 320px); gap: 10px; }
.ark-stage { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; min-height: 0; }
.ark-banner { margin: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--gold-grad); color: var(--ink); font-weight: 800; min-height: 48px; }
.ark-banner .text-button { margin-left: auto; color: var(--ink); text-decoration: underline; font-weight: 800; }
.ark-map-box { position: relative; height: calc(100vh - 330px); min-height: 420px; }
.ark-map-box .ark-map { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
.ark-map-box .ark-tools { position: absolute; top: 10px; left: 10px; z-index: 2; }
.ark-map-box .ark-tools button { box-shadow: var(--shadow-sm); }
.ark-schematic { position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgba(10, 14, 28, 0.78); color: var(--gold-soft); font-size: 0.78rem; font-weight: 700; }
.ark-roster, .ark-detail { max-height: calc(100vh - 210px); }
.ark-person-meta { font-size: 0.72rem; text-align: right; max-width: 76px; line-height: 1.2; }
.ark-person-meta.missing { color: var(--gold-soft); font-weight: 700; }
.ark-check { display: block; width: 100%; text-align: left; background: none; box-shadow: none; color: var(--text-soft); font-weight: 500; min-height: 0; padding: 4px 0 4px 10px; border-radius: 0; }
button.ark-check[data-ark]:hover { color: var(--text); text-decoration: underline; transform: none; }
.ark-pick h3 { margin-top: 10px; }
.ark-chips, .ark-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.ark-chips button, .ark-roles button { min-height: 40px; padding: 6px 12px; background: var(--inset); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; font-weight: 700; }
.ark-chips button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-soft); }
.ark-roles .suggested { background: var(--gold-grad); color: var(--ink); border-color: transparent; }
.ark-roles small { font-weight: 700; opacity: 1; color: inherit; font-size: 0.75rem; }
.ark-play { width: auto !important; padding: 6px 14px !important; }
/* Full screen: the editor covers the whole window, above the portal menus. */
.ark-editor.full { position: fixed; inset: 0; z-index: 60; background: var(--bg); padding: 10px 14px; overflow: auto; }
.ark-editor.full .ark-map-box { height: calc(100vh - 250px); }
.ark-editor.full .ark-roster, .ark-editor.full .ark-detail { max-height: calc(100vh - 140px); }
@media (max-width: 1100px) {
  .ark-body { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); }
}
@media (max-width: 720px) {
  .ark-steps li { flex: 1 1 100%; }
  .ark-map-box { height: 62vh; min-height: 320px; }
  .ark-editor.full .ark-map-box { height: 70vh; }
  .ark-roster, .ark-detail { max-height: none; }
  .ark-full-button, .ark-version { display: none; }
}
/* The page entrance animation leaves a transform on #main's children: it would trap the fixed full screen. */
#main > .ark-slot { animation: none; }
html.ark-full .masthead, html.ark-full .main-navigation, html.ark-full .mobile-dock, html.ark-full footer { display: none; }
html.ark-full body { overflow: hidden; }
@media (max-width: 720px) {
  .ark-body { grid-template-columns: minmax(0, 1fr); }
  .ark-steps { flex-wrap: nowrap; gap: 6px; }
  .ark-steps li { flex: 1 1 0; min-width: 0; }
  .ark-steps button { flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; min-height: 0; text-align: center; font-size: 0.78rem; }
  .ark-steps button small { margin: 0; font-size: 0.7rem; }
  .ark-banner { font-size: 0.9rem; padding: 8px 12px; }
  .ark-head-tools { width: 100%; }
}
/* The Ark map gets the whole width on a computer; on a phone the box takes the field's own shape
   (turned from your side when the team has one), never taller than the screen. */
.workspace:has(.ark-editor) { max-width: none; }
@media (max-width: 720px) {
  .ark-map-box, .ark-editor.full .ark-map-box { height: auto; min-height: 0; }
  .ark-map-box .ark-map { height: auto; aspect-ratio: var(--ark-ratio, 2000 / 1532); max-height: calc(100dvh - 190px); }
}
.ark-side-pick { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--gold-b); border-radius: var(--radius-sm); }
.ark-side-pick strong { flex: 1 1 100%; font-size: 1.05rem; }
.ark-side-pick button { flex: 1 1 220px; display: grid; gap: 2px; text-align: left; min-height: 60px; padding: 10px 14px; background: var(--inset); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; }
.ark-side-pick button.suggested { background: var(--gold-grad); color: var(--ink); border-color: transparent; }
.ark-side-pick button small { font-weight: 600; opacity: 0.85; color: inherit; }
.ark-side-pick button { justify-items: start; }
.ark-arrange button { margin-top: 6px; }
.ark-base ellipse { fill: rgba(244, 189, 79, 0.12); stroke: var(--gold-a); stroke-width: 3; stroke-dasharray: 14 10; vector-effect: non-scaling-stroke; pointer-events: none; }
.ark-base text { font: 800 22px var(--sans); text-anchor: middle; fill: #1d1305; paint-order: stroke; stroke: rgba(255, 240, 200, 0.95); stroke-width: 5px; pointer-events: none; }
.ark-path.team-a { stroke: #b07a12; }
.ark-path.team-b { stroke: #1f7fb0; }
.ark-path.team-ab { stroke: #7a54c4; }
/* Links: red dashes flowing towards the target over a light border; backups grey and thinner. */
.ark-link-edge { stroke: rgba(255, 248, 236, 0.92); stroke-linecap: round; pointer-events: none; }
.ark-link { stroke: #e5484d; stroke-linecap: round; fill: none; pointer-events: none; animation: ark-dash 1.4s linear infinite; }
.ark-link.backup { stroke: #7d7468; }
.ark-link-edge.backup { stroke: rgba(255, 248, 236, 0.6); }
.ark-link.selected, .ark-link.own { stroke: #ff2d36; }
.ark-link-edge.selected, .ark-link-edge.own { stroke: #fff; }
@keyframes ark-dash { to { stroke-dashoffset: var(--dash-end, -40); } }
@media (prefers-reduced-motion: reduce) { .ark-link { animation: none; } }
/* Marches: the route is a broken line (fill none), with small arrows all along it. */
.ark-link-edge { fill: none; stroke-linejoin: round; }
.ark-link { stroke-linejoin: round; }
.ark-chevron { fill: #fff8ec; stroke: #e5484d; stroke-width: 0.45; pointer-events: none; }
.ark-chevron.backup { stroke: #7d7468; }
.ark-chevron.selected, .ark-chevron.own { fill: #fff; stroke: #ff2d36; }
/* Handles of the selected task's routes: a dot moves a bend, a "+" adds one. */
.ark-bend, .ark-bend-add { cursor: grab; }
.ark-bend circle { fill: #fff; stroke: #e5484d; stroke-width: 4; }
.ark-bend-add circle { fill: rgba(255, 255, 255, 0.9); stroke: #e5484d; stroke-width: 2.5; }
.ark-bend-add path { stroke: #e5484d; stroke-width: 2.5; stroke-linecap: round; }
.ark-bend:hover circle, .ark-bend-add:hover circle { fill: #ffd23f; }
/* The Anubis altars: a marker the staff drags (their real place is unknown). */
.ark-anubis { cursor: grab; }
.ark-anubis-mark circle { fill: #6e56cf; stroke: #fff8ec; stroke-width: 4; }
.ark-anubis-mark text { font: 800 26px var(--sans); text-anchor: middle; fill: #fff; pointer-events: none; }
.ark-building.ark-anubis.estimated circle { stroke: transparent; }
.ark-building.ark-anubis.estimated .ark-anubis-mark circle { stroke-dasharray: 6 5; opacity: 0.85; }
.ark-item { cursor: grab; }
/* Where a drag would land. */
.ark-building.drop circle { stroke: #ffd23f; stroke-width: 10; fill: rgba(255, 210, 63, 0.18); }
.ark-item.drop path { stroke: #ffd23f; stroke-width: 6; }
/* The story of the match: a box over the bottom of the map. */
.ark-story { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; width: min(560px, calc(100% - 90px)); padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(10, 14, 28, 0.9); border: 1px solid var(--gold-b); box-shadow: var(--shadow); animation: ark-story-in 0.35s var(--ease); }
.ark-story[hidden] { display: none; }
.ark-story .eyebrow { margin: 0 0 4px; }
.ark-story ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.ark-story-controls { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.ark-story-controls button { min-height: 36px; padding: 4px 12px; }
.ark-story-controls .text-button { margin-left: auto; }
@keyframes ark-story-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ark-story { animation: none; } }
@media (max-width: 720px) { .ark-story { width: calc(100% - 20px); bottom: 8px; font-size: 0.88rem; } }
/* A governor chosen: the buildings that can take a task glow. */
.ark-svg.targeting .ark-building circle { stroke: rgba(255, 255, 255, 0.75); stroke-width: 5; stroke-dasharray: 8 7; animation: ark-glow 1.6s ease-in-out infinite; }
@keyframes ark-glow { 50% { stroke: rgba(255, 211, 110, 0.95); } }
@media (prefers-reduced-motion: reduce) { .ark-svg.targeting .ark-building circle { animation: none; } }
/* First visit: three screens over the editor. */
.ark-editor { position: relative; }
.ark-intro { position: absolute; inset: 0; z-index: 70; display: grid; place-items: start center; padding-top: 120px; background: rgba(7, 10, 20, 0.6); }
.ark-intro[hidden] { display: none; }
.ark-intro-card { width: min(460px, calc(100% - 32px)); padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--gold-b); box-shadow: var(--shadow-lg); }
.ark-intro-card h2 { margin: 4px 0 8px; }
.ark-intro-card .actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
/* Routes share the link look; zones are a light red area with a dashed edge. */
.ark-route { fill: none; stroke-linejoin: round; }
polyline.ark-link-edge { fill: none; stroke-linejoin: round; }
.ark-zone { fill: rgba(229, 72, 77, 0.14); stroke: #e5484d; pointer-events: none; }
.ark-zone.selected { fill: rgba(229, 72, 77, 0.24); }
/* Story arrows travelling along the routes. */
.ark-march path { fill: #e5484d; stroke: #fff8ec; stroke-width: 3; stroke-linejoin: round; }
.ark-march.own path { fill: #ff2d36; stroke: #fff; }
.ark-march { pointer-events: none; }
/* The staff's own roles, in "Settings and filters". */
.ark-roles-panel { flex: 1 1 100%; display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.ark-roles-panel h2 { margin: 0; font-size: 1rem; }
.ark-custom-roles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ark-custom-roles li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.ark-role-mark { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 999px; background: var(--gold-a); color: #1d1305; font-weight: 800; }
.ark-role-add { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: flex-end; max-width: 560px; }
.ark-role-add input { min-height: 38px; padding-block: 6px; }
.ark-role-add button { min-height: 38px; }
.ark-role-add .ark-field { flex: 1 1 180px; }
.ark-role-add .ark-role-mark-field { flex: 0 0 80px; }
.ark-custom-roles button:disabled { opacity: 0.35; cursor: not-allowed; }
/* Ark plan, player view: "your task" first, then the map (one under the other on a phone). */
.ark-player { --team-a: #f4bd4f; --team-b: #5cc8ff; --team-ab: #c9a7ff; --team-r: #a3acc9; display: grid; gap: 14px; }
/* The editor hides the version on a phone; a player needs it (which plan am I reading?). */
.ark-player .ark-version { display: inline; }
.ark-player-body { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .ark-player-body { grid-template-columns: 1fr; } }
.ark-brief { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface, rgba(255, 255, 255, 0.04)); border: 1px solid var(--line); }
.ark-brief h2 { margin: 0 0 6px; font-size: 1.15rem; }
.ark-brief h3 { margin: 14px 0 6px; font-size: 0.95rem; color: var(--gold-soft); }
.ark-brief-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ark-brief-list li { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.04); }
.ark-brief-list li > span { color: var(--text-soft); font-size: 0.9rem; }
.ark-brief-task { justify-self: start; justify-content: flex-start; text-align: start; padding: 0; min-height: 0; }
.ark-brief-duty { font-weight: 700; color: var(--text) !important; }
.ark-card-button { margin: 4px 0 6px; }
.ark-changes { margin: 10px 0 4px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--gold-b); background: rgba(244, 189, 79, 0.08); }
.ark-changes h3 { margin: 0 0 6px; }
.ark-changes p { margin: 0; color: var(--text-soft); }
.ark-changes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ark-changes li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.ark-changes .text-button { padding: 0; min-height: 0; text-align: start; }
.ark-change-tag { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--gold-soft); }
.ark-ghost { opacity: 0.45; pointer-events: none; }
.ark-ghost path { stroke-dasharray: 4 3; }
.ark-ghost.gone path { stroke: var(--red-strong); stroke-width: 3; }
.ark-moved { stroke: #ffd36e; fill: none; stroke-linecap: round; pointer-events: none; }
.ark-read.done { color: var(--green, #46a758); font-weight: 700; }
.ark-preview { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0; }
.ark-preview select { min-height: 38px; padding-block: 6px; }
.ark-reads summary { cursor: pointer; color: var(--text-soft); font-size: 0.85rem; }
.ark-reads p { margin: 6px 0 0; font-size: 0.85rem; max-width: 420px; }
.ark-player .ark-detail:empty { display: none; }
@media print {
  .ark-player .ark-stage, .ark-player .ark-head-tools button, .ark-preview { display: none !important; }
  .ark-player-body { grid-template-columns: 1fr; }
  .ark-brief { border: 0; background: none; color: #000; }
  .ark-brief-list li { background: none; border-bottom: 1px solid #999; border-radius: 0; }
  .ark-brief-list li > span, .ark-brief h3 { color: #000 !important; }
}
/* The Ark guide: steps with a picture, over the page. */
.ark-guide { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(6, 9, 20, 0.72); }
.ark-guide-card { width: min(880px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px 22px; border-radius: var(--radius-sm); background: var(--panel, #141a2e); border: 1px solid var(--gold-b, #6b5523); box-shadow: var(--shadow); }
.ark-guide-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -18px; margin-top: -18px; padding: 16px 0 10px; background: var(--panel, #141a2e); z-index: 1; }
.ark-guide-head h2 { margin: 0; font-size: 1.25rem; }
.ark-guide-steps { margin: 0; padding-left: 22px; display: grid; gap: 18px; }
.ark-guide-steps h3 { margin: 0 0 4px; font-size: 1.02rem; color: var(--gold-soft); }
.ark-guide-steps p { margin: 0 0 8px; color: var(--text-soft); line-height: 1.5; }
.ark-guide-steps img { display: block; max-width: 100%; max-height: 60vh; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
@media print { .ark-guide { display: none !important; } }

/* Another kingdom's mark until it has its own crest (phase D3). */
.kingdom-badge{display:grid;place-items:center;aspect-ratio:1;border-radius:50%;border:2px solid var(--gold,#f4bd4f);color:var(--gold,#f4bd4f);font:700 clamp(2.5rem,12vw,4.5rem)/1 'Cinzel',Georgia,serif}

/* The platform's entry page (rokingdoms.com). */
.entry-page{max-width:960px;margin:0 auto;padding:24px 16px 48px;display:grid;gap:32px}
.entry-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.entry-logo img{display:block;width:min(260px,55vw);height:auto}
.entry-hero h1{margin:0 0 8px}
.entry-kingdoms,.entry-side{display:grid;gap:16px}
/* Phone: the words first, then the kingdoms. Desktop: kingdoms on both sides, the words in the middle. */
.entry-kingdoms .entry-hero{order:-1}
@media (min-width:900px){
  .entry-kingdoms{grid-template-columns:220px 1fr 220px;align-items:center;gap:32px}
  .entry-kingdoms .entry-hero{order:0;text-align:center}
  .entry-top{position:relative;justify-content:center}
  .entry-top .lang-menu{position:absolute;right:0}
  .entry-logo img{width:320px}
}
.entry-kingdom{display:grid;justify-items:center;gap:10px;padding:20px 16px;border-radius:20px;background:var(--panel,#141b33);border:1px solid var(--line,#26305a);text-decoration:none;color:inherit;text-align:center}
.entry-kingdom img,.entry-badge{width:120px;height:120px}
.entry-badge{font-size:2rem}
.entry-kingdom-name b{color:var(--gold,#f4bd4f)}
.entry-foot{text-align:center}
.entry-foot small{opacity:.75}
.entry-contacts{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.entry-contact{display:grid;gap:6px;text-decoration:none;color:inherit;word-break:break-word}
.entry-contact b{color:var(--gold,#f4bd4f);font-size:1.1rem}
.entry-contact span{color:var(--text)}
.entry-opening{position:fixed;inset:0;z-index:100;background:#0a0e1c;cursor:pointer;transition:opacity .5s ease}
.entry-opening canvas{display:block;width:100%;height:100%}
.entry-opening.closing{opacity:0}
/* The entry page's presentation sections. */
.entry-lead{margin:0 0 16px;max-width:720px;color:var(--text-soft)}
.entry-features,.entry-phone{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.entry-feature{padding:20px;border-radius:20px;background:var(--panel,#141b33);border:1px solid var(--line,#26305a)}
.entry-feature h3{margin:12px 0 6px;font-size:1.05rem}
.entry-feature p{margin:0;color:var(--text-soft)}
.entry-feature-icon{display:inline-grid;place-items:center;width:44px;height:44px;border-radius:14px;background:rgba(244,189,79,.12);color:var(--gold,#f4bd4f)}
.entry-feature-icon .icon{width:24px;height:24px}
.entry-phone ol{margin:10px 0 0;padding-left:20px;display:grid;gap:6px;color:var(--text-soft)}
.entry-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}
.entry-steps li{padding:20px;border-radius:20px;border:1px solid var(--line,#26305a)}
.entry-steps h3{margin:12px 0 6px;font-size:1.05rem}
.entry-steps p{margin:0;color:var(--text-soft)}
.entry-step-n{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#ffd36e,#e59a2f);color:#1d1305;font-weight:800}
.entry-note{display:flex;gap:10px;align-items:flex-start;margin:16px 0 0;color:var(--text-soft)}
.entry-note .icon{flex:none;width:20px;height:20px;color:var(--gold,#f4bd4f)}
.entry-checks{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.entry-checks li{display:flex;gap:10px;align-items:center}
.entry-checks .icon{flex:none;width:18px;height:18px;color:var(--gold,#f4bd4f)}
.entry-faq{padding:14px 0;border-bottom:1px solid var(--line,#26305a)}
.entry-faq summary{cursor:pointer;font-weight:700}
.entry-faq p{margin:8px 0 0;color:var(--text-soft)}
/* Entry page: the language choice sits in the footer, discreet (flag and name, no frame); its list opens upwards. */
.entry-top{justify-content:center}
.entry-foot .lang-menu{justify-self:center}
.entry-foot .lang-list{top:auto;bottom:calc(100% + 8px);right:50%;transform:translateX(50%);text-align:left}
.entry-foot .lang-menu>summary{min-height:36px;padding:0 10px;gap:6px;border-color:transparent;background:transparent;box-shadow:none}
.entry-foot .lang-menu>summary:hover,.entry-foot .lang-menu>summary:focus-visible,.entry-foot .lang-menu[open]>summary{border-color:var(--line-strong);box-shadow:none}
.entry-foot{display:grid;gap:6px}
/* Illustrated banners of the entry page's sections (RoK-style scenes, dark on the left for the text). */
.entry-banner{position:relative;display:flex;align-items:center;min-height:380px;margin-bottom:16px;padding:32px;border:1px solid var(--line,#26305a);border-radius:24px;overflow:hidden;background:#0a0e1c right center/auto 100% no-repeat}
.entry-banner::before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,14,28,.96) 0%,rgba(10,14,28,.8) 38%,rgba(10,14,28,0) 68%)}
.entry-banner-text{position:relative;display:grid;gap:12px;justify-items:start;max-width:min(470px,56%)}
.entry-banner-text h2{margin:0;font-family:var(--display);font-weight:700;font-size:clamp(1.5rem,3.2vw,2.3rem);line-height:1.15;letter-spacing:.02em}
.entry-banner-text p{margin:0;color:var(--text-soft)}
.entry-scene-kingdom{background-image:url(/assets/platform/scenes/kingdom.webp)}
.entry-scene-council{background-image:url(/assets/platform/scenes/council.webp)}
.entry-scene-phone{background-image:url(/assets/platform/scenes/phone.webp)}
.entry-scene-strategy{background-image:url(/assets/platform/scenes/strategy.webp)}
.entry-scene-forge{background-image:url(/assets/platform/scenes/forge.webp)}
.entry-scene-knight{background-image:url(/assets/platform/scenes/knight.webp)}
.entry-scene-contact{background-image:url(/assets/platform/scenes/contact.webp)}
.entry-section>.back-link{display:inline-block;margin-bottom:12px}
/* Phones: the scene on top, the text below it on the dark fade. */
@media (max-width:700px){
  .entry-banner{align-items:flex-end;min-height:0;padding:170px 20px 20px;background-size:auto 260px;background-position:72% top}
  .entry-banner::before{background:linear-gradient(180deg,rgba(10,14,28,0) 0,rgba(10,14,28,.2) 110px,rgba(10,14,28,.92) 210px,#0a0e1c 100%)}
  .entry-banner-text{max-width:none}
}
/* Migration request: five example screens in a row (two per row on phones). */
.migration-example-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  max-width: none;
}

.migration-example-grid img {
  aspect-ratio: 2.17;
  object-fit: cover;
}

/* "Install the app": card with the guide button (closable on the home page); the guide shows the
   video of the visitor's phone above its steps. */
.install-video {
  display: block;
  width: min(100%, 200px);
  aspect-ratio: 9 / 16;
  margin: 12px auto 0;
  border-radius: 18px;
  background: var(--bg-deep);
}

.install-guide .actions {
  margin-top: 14px;
}
.install-card {
  position: relative;
}

.install-card ol {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.install-both {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.install-both h3 {
  margin: 12px 0 0;
  font-size: 1rem;
}

.install-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.install-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 0;
  padding: 4px 10px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 1.3rem;
}
