:root {
  --bg: #14111f;
  --bg-glow: #2a1f3d;
  --text: #f3e9dc;
  --muted: #b8a9c4;
  --accent: #f2c38b;
  --el-fire: #f07a5a;
  --el-water: #6db4f2;
  --el-earth: #d9a066;
  --el-wind: #7fd18b;
  --el-light: #f5dc7a;
  --el-dark: #b48cf2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1px 1px at 12% 20%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 14%, #fff9 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 64%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 38%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 86%, #fff7 50%, transparent 51%),
    radial-gradient(ellipse at 50% 110%, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

a {
  color: var(--accent);
}

/* Navbar */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.nav-brand {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: #ffffff14;
}

/* Home hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 5rem);
  padding: 0 1rem 5rem;
  text-align: center;
}

.hero-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "SOFT" 100;
  font-size: clamp(3.5rem, 14vw, 9rem);
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: 0 0 40px #f2c38b40;
}

.hero-tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Generic page */

.page {
  max-width: 40rem;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.page-title {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2.5rem;
}

.page-intro {
  color: var(--muted);
}

/* Crew card plate */

.plate {
  --el: var(--accent);
  position: relative;
  margin: 2rem 0;
  padding: 1.75rem;
  border: 1px solid #f2c38b55;
  border-radius: 1.25rem;
  background:
    linear-gradient(160deg, #2a1f3dcc, #1a1529ee),
    var(--bg);
  box-shadow:
    inset 0 0 0 4px #14111f,
    inset 0 0 0 5px #f2c38b2a,
    0 20px 50px #0008;
}

.plate::before,
.plate::after {
  content: "✦";
  position: absolute;
  top: 0.6rem;
  color: var(--accent);
  font-size: 0.8rem;
  opacity: 0.7;
}

.plate::before { left: 0.9rem; }
.plate::after { right: 0.9rem; }

.plate--fire  { --el: #f07a5a; }
.plate--water { --el: #6db4f2; }
.plate--earth { --el: #d9a066; }
.plate--wind  { --el: #7fd18b; }
.plate--light { --el: #f5dc7a; }
.plate--dark  { --el: #b48cf2; }

article.plate {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  border-color: color-mix(in srgb, var(--el) 60%, transparent);
  box-shadow:
    inset 0 0 0 4px #14111f,
    inset 0 0 0 5px color-mix(in srgb, var(--el) 30%, transparent),
    0 0 40px color-mix(in srgb, var(--el) 20%, transparent),
    0 20px 50px #0008;
}

.plate-portrait {
  flex: none;
  display: grid;
  place-items: center;
  width: 7.5rem;
  height: 7.5rem;
  overflow: hidden;
  border: 3px solid var(--el);
  border-radius: 50%;
  background: #14111f;
  font-size: 3rem;
  box-shadow: 0 0 20px color-mix(in srgb, var(--el) 40%, transparent);
}

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

.plate-body {
  min-width: 0;
}

.plate-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* The name, with the Player ID beside it when there is one. */
.plate-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.75rem;
  margin: 0.2rem 0 0.75rem;
}

.plate-name {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 2rem;
  overflow-wrap: anywhere;
}

.plate-stats {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.plate-stats dt {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.plate-stats dd {
  margin: 0.1rem 0 0;
}

.plate-muted {
  color: var(--muted);
}

/* Centred with flex rather than sat on the text baseline: the emoji glyph's
   font metrics differ in the copied image, which pushed the label down. */
.element-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  line-height: 1.3;
  vertical-align: middle;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--el);
  border-radius: 999px;
  background: color-mix(in srgb, var(--el) 18%, transparent);
}

/* Raid gems: a hexagonal gem per raid, split into a slice per element. */

.raid-gems {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.raid-gem {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
}

.gem {
  --gem-shape: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  --gem-fill: #ffffff10;
  position: relative;
  display: block;
  width: 2rem;
  height: 2.3rem;
  clip-path: var(--gem-shape);
  /* The gem's rim. */
  background: #f3e9dccc;
}

/* The coloured body, with a light sheen over the element slices. */
.gem::before {
  content: "";
  position: absolute;
  inset: 2px;
  clip-path: var(--gem-shape);
  background:
    linear-gradient(160deg, #ffffff66, transparent 45%, #00000040),
    var(--gem-fill);
}

/* The flat top facet. */
.gem::after {
  content: "";
  position: absolute;
  inset: 32% 30%;
  clip-path: var(--gem-shape);
  background: #ffffff38;
}

.gem--empty {
  background: #ffffff30;
}

.gem--empty::after {
  background: #ffffff10;
}

.raid-gem-label {
  color: var(--muted);
  font-size: 0.75rem;
}

.plate-actions {
  text-align: center;
}

@media (max-width: 30rem) {
  article.plate {
    flex-direction: column;
    text-align: center;
  }

  .plate-title,
  .raid-gems {
    justify-content: center;
  }
}

/* Crew card form */

.plate-form {
  display: grid;
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field label,
.field legend {
  padding: 0;
  font-weight: 600;
}

.field legend {
  margin-bottom: 0.4rem;
}

.field input[type="text"],
.field input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ffffff26;
  border-radius: 0.6rem;
  background: #14111f;
  color: var(--text);
  font: inherit;
}

.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field input[aria-invalid="true"] {
  border-color: #f07a5a;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.field-error,
.form-alert {
  margin: 0;
  color: #ffab94;
  font-size: 0.9rem;
}

.form-alert {
  padding: 0.6rem 0.85rem;
  border: 1px solid #f07a5a66;
  border-radius: 0.6rem;
  background: #f07a5a1a;
}

.element-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.5rem;
}

.element-option {
  --el: var(--accent);
  position: relative;
  cursor: pointer;
}

.element-option--fire  { --el: #f07a5a; }
.element-option--water { --el: #6db4f2; }
.element-option--earth { --el: #d9a066; }
.element-option--wind  { --el: #7fd18b; }
.element-option--light { --el: #f5dc7a; }
.element-option--dark  { --el: #b48cf2; }

.element-option input {
  position: absolute;
  opacity: 0;
}

.element-option > span {
  display: block;
  padding: 0.55rem 0.5rem;
  border: 1px solid #ffffff26;
  border-radius: 0.6rem;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s;
}

.element-option:hover > span {
  border-color: var(--el);
}

.element-option input:checked + span {
  border-color: var(--el);
  background: color-mix(in srgb, var(--el) 22%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--el) 35%, transparent);
}

.element-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Crew picker: three big emblem cards, like choosing a starter. */

.crew-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.crew-option {
  --crew: var(--accent);
  position: relative;
  cursor: pointer;
}

.crew-option--celestials { --crew: #f2c38b; }
.crew-option--terranova  { --crew: #7fd18b; }
.crew-option--whiskey    { --crew: #e0975a; }

.crew-option input {
  position: absolute;
  opacity: 0;
}

.crew-option-card {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.1rem 0.5rem 1rem;
  border: 1px solid #ffffff26;
  border-radius: 1rem;
  background: #14111f;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.crew-option-emblem {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border: 2px solid color-mix(in srgb, var(--crew) 45%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--crew) 22%, transparent), transparent 70%);
  color: var(--crew);
  font-size: 2rem;
  line-height: 1;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.crew-option-name {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.1rem;
}

.crew-option:hover .crew-option-card {
  transform: translateY(-3px);
  border-color: var(--crew);
}

.crew-option input:checked + .crew-option-card {
  transform: translateY(-4px);
  border-color: var(--crew);
  background: color-mix(in srgb, var(--crew) 16%, #14111f);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--crew) 30%, transparent);
}

.crew-option input:checked + .crew-option-card .crew-option-emblem {
  border-color: var(--crew);
  box-shadow: 0 0 18px color-mix(in srgb, var(--crew) 55%, transparent);
}

.crew-option input:focus-visible + .crew-option-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 30rem) {
  .crew-picker {
    gap: 0.5rem;
  }

  .crew-option-emblem {
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
  }

  .crew-option-name {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .crew-option-card {
    transition: none;
  }

  .crew-option:hover .crew-option-card,
  .crew-option input:checked + .crew-option-card {
    transform: none;
  }
}

.raid-field {
  display: grid;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.raid-field legend {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.element-picker--compact {
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.4rem;
}

.element-picker--compact .element-option > span {
  padding: 0.4rem 0.4rem;
  font-size: 0.9rem;
}

.button {
  justify-self: start;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #14111f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px #f2c38b40;
}

/* Roster */

.page--wide {
  max-width: 64rem;
}

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.roster .plate {
  margin: 0;
  scroll-margin-top: 2rem;
}

.roster .plate[hidden] {
  display: none;
}

.roster-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: end;
  margin-top: 2rem;
}

.roster-filters[hidden] {
  display: none;
}

.roster-filters input[type="search"],
.roster-filters select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ffffff26;
  border-radius: 0.6rem;
  background: #14111f;
  color: var(--text);
  font: inherit;
}

.roster-filters select:focus-visible,
.roster-filters input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.roster-filters-status {
  grid-column: 1 / -1;
}

/* Mini filters: a row of pills under the search and dropdowns. */

.roster-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.chip-group legend {
  float: left;
  margin-right: 0.25rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chip {
  --chip: var(--accent);
  position: relative;
  cursor: pointer;
}

.chip--celestials { --chip: #f2c38b; }
.chip--terranova  { --chip: #7fd18b; }
.chip--whiskey    { --chip: #e0975a; }

.chip input {
  position: absolute;
  opacity: 0;
}

.chip > span {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border: 1px solid #ffffff26;
  border-radius: 999px;
  font-size: 0.85rem;
  transition: border-color 0.2s, background-color 0.2s;
}

.chip:hover > span {
  border-color: var(--chip);
}

.chip input:checked + span {
  border-color: var(--chip);
  background: color-mix(in srgb, var(--chip) 20%, transparent);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip-hint {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.roster-filters-status:empty {
  display: none;
}

@media (max-width: 40rem) {
  .roster-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .roster-search {
    grid-column: 1 / -1;
  }
}

.roster-empty {
  margin-top: 2rem;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.roster .plate-portrait {
  width: 5.5rem;
  height: 5.5rem;
  font-size: 2.25rem;
}

.roster .plate-name {
  font-size: 1.6rem;
}

/* The card someone just submitted is the redirect's #fragment target. */
.roster .plate:target {
  animation: plate-arrive 2.4s ease-out;
}

@keyframes plate-arrive {
  0%, 30% {
    box-shadow:
      inset 0 0 0 4px #14111f,
      0 0 0 3px var(--el),
      0 0 60px var(--el);
  }
}

@media (prefers-reduced-motion: reduce) {
  .roster .plate:target {
    animation: none;
    outline: 3px solid var(--el);
  }
}

/* Admin */

.page--narrow {
  max-width: 26rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.field input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ffffff26;
  border-radius: 0.6rem;
  background: #14111f;
  color: var(--text);
  font: inherit;
}

.form-notice {
  padding: 0.6rem 0.85rem;
  border: 1px solid #7fd18b66;
  border-radius: 0.6rem;
  background: #7fd18b1a;
  color: #b5ecbd;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
  border: 1px solid #f2c38b33;
  border-radius: 1rem;
  background: #1a1529cc;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-table tbody tr {
  border-top: 1px solid #ffffff14;
}

.admin-member {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.admin-member a {
  color: var(--text);
}

.admin-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  overflow: hidden;
  border: 2px solid var(--el);
  border-radius: 50%;
  background: #14111f;
}

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

.admin-raids .raid-gems {
  flex-wrap: nowrap;
  gap: 0.6rem;
  margin: 0;
}

.admin-raids .gem {
  width: 1.4rem;
  height: 1.6rem;
}

.admin-raids .raid-gem-label {
  font-size: 0.65rem;
}

.admin-actions {
  text-align: right;
}

.admin-actions form {
  display: inline-block;
  margin-left: 0.4rem;
}

.button--quiet {
  background: #ffffff14;
  color: var(--text);
}

.button--danger {
  padding: 0.4rem 0.9rem;
  background: transparent;
  border: 1px solid #f07a5a99;
  color: #ffab94;
}

.button--danger:hover {
  background: #f07a5a26;
  box-shadow: none;
}

.button--small {
  padding: 0.4rem 0.9rem;
}

/* Editing a crew card */

.edit-link {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid #f2c38b33;
  border-radius: 1rem;
  background: #1a1529cc;
}

.edit-link--new {
  border-color: var(--accent);
  box-shadow: 0 0 24px #f2c38b33;
}

.edit-link-title {
  margin: 0;
  font-size: 1rem;
}

.edit-link-url {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid #ffffff26;
  border-radius: 0.6rem;
  background: #14111f;
  color: var(--accent);
  font: 0.85rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.edit-link-url:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.picture-current {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.picture-current img {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.field .picture-remove {
  font-weight: 400;
}

.plate-actions {
  position: absolute;
  /* Clear of the inner border ring and the corner star. */
  top: 1.4rem;
  right: 2.1rem;
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  font-size: 0.85rem;
}

.plate-copy {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.plate-copy:hover {
  text-decoration: underline;
}

.plate-copy:disabled {
  color: var(--muted);
  cursor: progress;
  text-decoration: none;
}

/* Availability grid on the crew card */

.avail-wrap {
  overflow-x: auto;
}

.avail-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  user-select: none;
}

.avail-grid th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.avail-grid thead th {
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.avail-grid abbr {
  text-decoration: none;
}

.avail-grid tbody th {
  padding-right: 0.4rem;
  text-align: right;
}

.avail-grid tbody th small {
  display: block;
  font-weight: 400;
  opacity: 0.8;
}

.avail-grid td {
  padding: 0;
}

.avail-cell {
  position: relative;
  display: block;
  cursor: pointer;
}

.avail-cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avail-cell span {
  display: block;
  min-width: 2rem;
  height: 2.25rem;
  border-radius: 0.25rem;
  background: #ffffff0d;
  transition: background 0.1s;
}

.avail-cell:hover span {
  background: #ffffff21;
}

.avail-cell input:checked + span {
  background: var(--accent);
  box-shadow: 0 0 8px #f2c38b55;
}

.avail-cell input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Exceptions to the usual times, on the edit page */

.exceptions {
  display: grid;
  gap: 1rem;
}

.exceptions-title,
.exception-form-title {
  margin: 0;
  font-size: 1.1rem;
}

.exceptions .form-notice,
.exceptions > .plate-muted {
  margin: 0;
}

.exception-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.exception {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid #ffffff1a;
  border-radius: 0.6rem;
  background: #14111f;
}

.exception-days {
  font-weight: 600;
}

.exception-summary {
  flex: 1;
  color: var(--muted);
}

.exception-summary--away {
  color: #ffab94;
}

.exception form {
  margin: 0;
}

.exception-form {
  display: grid;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ffffff1a;
}

.exception-form input[type="date"] {
  width: 100%;
  max-width: 14rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ffffff26;
  border-radius: 0.6rem;
  background: #14111f;
  color: var(--text);
  color-scheme: dark;
  font: inherit;
}

.exception-week {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  cursor: pointer;
}

.exception-week input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.exception-week .plate-muted {
  font-weight: 400;
}

[data-exception-day] .element-picker + .element-picker {
  margin-top: 0.4rem;
}

.exception-busy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.4rem;
}

.exception-busy label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}

.exception-busy select {
  padding: 0.5rem 0.7rem;
  border: 1px solid #ffffff26;
  border-radius: 0.6rem;
  background: #14111f;
  color: var(--text);
  font: inherit;
}

.exception-busy select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.exception--weekly {
  border-color: #f2c38b40;
}

[data-exception-day][hidden],
[data-exception-blocks][hidden],
[data-exception-busy][hidden],
[data-exception-repeat][hidden] {
  display: none;
}

/* Admin availability planner */

.planner {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0 2.5rem;
  padding: 1.25rem;
  border: 1px solid #f2c38b33;
  border-radius: 1rem;
  background: #1a1529cc;
}

.planner-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
}

.planner-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
}

.planner-quick[hidden] {
  display: none;
}

.planner-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.planner-member {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border: 1px solid #ffffff1f;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
}

.planner-member:has(input:checked) {
  border-color: var(--accent);
  background: #f2c38b1f;
}

.planner-member--none {
  cursor: default;
  opacity: 0.6;
}

.planner-member input {
  accent-color: var(--accent);
}

.planner-best-title {
  margin: 0.5rem 0 0.25rem;
  font-size: 1rem;
}

.planner-none {
  margin: 0;
  color: #ffab94;
}

.planner-picks {
  display: grid;
  gap: 0.4rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.planner-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: baseline;
  padding: 0.55rem 0.85rem;
  border: 1px solid #ffffff1a;
  border-radius: 0.75rem;
  background: #14111f;
}

.planner-pick--all {
  border-color: var(--el-wind);
  background: color-mix(in srgb, var(--el-wind) 12%, #14111f);
}

.planner-pick-rank {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--accent);
  color: #14111f;
  font-size: 0.75rem;
  font-weight: 700;
}

.planner-pick-len {
  color: var(--accent);
  font-weight: 600;
}

.planner-pick-who {
  color: var(--muted);
  font-size: 0.85rem;
}

.planner-pick--all .planner-pick-who {
  color: var(--el-wind);
  font-weight: 600;
}

.planner-grid-wrap {
  overflow-x: auto;
}

.planner-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px 0;
}

.planner-grid th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.planner-grid thead th {
  padding-bottom: 0.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Hour labels sit on the line where the hour starts. */
.planner-grid tbody th {
  padding-right: 0.4rem;
  text-align: right;
  vertical-align: top;
  line-height: 0;
}

.planner-cell {
  position: relative;
  min-width: 2.25rem;
  height: 0.7rem;
  padding: 0;
  background: #ffffff0a;
}

/* A faint line between hours, none between their halves. */
.planner-grid tbody tr:not(.planner-row--half) .planner-cell {
  border-top: 1px solid #14111f;
}

.planner-cell--some {
  background: color-mix(in srgb, var(--el-water) calc(var(--share) * 55%), #ffffff0a);
}

.planner-cell--all {
  background: var(--el-wind);
  box-shadow: 0 0 10px color-mix(in srgb, var(--el-wind) 60%, transparent);
  z-index: 1;
}

.planner-cell--best {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  z-index: 2;
}

.planner-cell--best span {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--accent);
  color: #14111f;
  font-size: 0.65rem;
  font-weight: 700;
}

.planner-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.planner-legend-item {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.planner-swatch {
  display: inline-block;
  width: 1rem;
  height: 0.7rem;
  border-radius: 0.2rem;
}

.planner-swatch.planner-cell--some {
  --share: 0.6;
}

.planner-swatch.planner-cell--best {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: transparent;
}

.plate-player-id {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.plate-player-id:hover,
.plate-player-id:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

/* Flex rather than grid so an option that wraps onto its own row stretches
   to fill it instead of sitting in a single column. */
.element-picker--wide {
  display: flex;
  flex-wrap: wrap;
}

.element-picker--wide .element-option {
  flex: 1 1 10rem;
}

.element-picker--wide .element-option > span {
  height: 100%;
}

.option-hint {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

/* Free hours on the roster */

.hours-changes {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #ffffff1a;
}

.hours-changes[hidden] {
  display: none;
}

.hours-none {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.hours-mine {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #ffffff1a;
}

.hours-mine[hidden] {
  display: none;
}

.hours-mine .exception-form-title {
  font-size: 1rem;
}

.hours-changes-title {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hours-changes ul {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hours-change {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  font-size: 0.9rem;
}

.hours-change-days {
  font-weight: 600;
}

.hours-change-away {
  color: #ffab94;
}


.plate-hours {
  margin-top: 0.85rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--el) 60%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--el) 12%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.plate-hours:hover {
  background: color-mix(in srgb, var(--el) 24%, transparent);
}

.plate-hours::before {
  content: "🕒 ";
}

.plate--has-hours {
  cursor: pointer;
}

.hours-dialog {
  width: min(34rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid #f2c38b55;
  border-radius: 1.25rem;
  background: linear-gradient(160deg, #2a1f3d, #1a1529);
  color: var(--text);
  box-shadow: 0 20px 60px #000a;
}

.hours-dialog::backdrop {
  background: #0a0812b3;
}

.hours-panel {
  position: relative;
  display: grid;
  gap: 0.5rem;
  padding: 1.5rem;
}

.hours-close-form {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.hours-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: #ffffff14;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.hours-close:hover {
  background: #ffffff26;
}

.hours-title {
  margin: 0;
  padding-right: 2.5rem;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
}

.hours-axis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0.5rem 0 0 3rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.hours-days {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hours-day {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.2rem 0;
  align-items: center;
}

.hours-day-name {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* A 24-hour strip, with faint marks every six hours. */
.hours-bar {
  position: relative;
  height: 0.75rem;
  border-radius: 0.3rem;
  background:
    linear-gradient(90deg, transparent calc(25% - 1px), #ffffff1f 0 25%, transparent 0 calc(50% - 1px), #ffffff1f 0 50%, transparent 0 calc(75% - 1px), #ffffff1f 0 75%, transparent 0),
    #ffffff0d;
  overflow: hidden;
}

.hours-bar-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 0.3rem;
  background: var(--accent);
  box-shadow: 0 0 8px #f2c38b66;
}

.hours-ranges {
  grid-column: 2;
  font-size: 0.85rem;
}

/* Day-block icons beside Morning, Afternoon, Evening and Late evening */

.block-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.block-icon {
  width: 1.5em;
  height: 1.5em;
  flex: none;
  transition: transform 0.2s;
}

.element-option:hover .block-icon,
.element-option input:checked + span .block-icon {
  transform: translateY(-1px) rotate(-6deg);
}
