/********************* ROOT VARIABLES *********************/

:root {
  --bg: #141b5c;
  --bg-2: #0d134a;
  --bg-3: #17205b;
  --green: #386c54;
  --danger: #ff435e;
  --hour-height: 40px;
  --time-col: 78px;
  --critter-col: minmax(86px, 96px);
  --top-offset: 83px;
  --button-text: 0.7rem;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  text-wrap: pretty;

  --text: #fffdf7;
  --muted: #c9d4ff;
  --gold: #f6d586;

  --slot-color: #8b6be2;
  --slot-color-dark: #714fbd;
  --slot-color-faint: color-mix(
    in srgb,
    var(--slot-color) 40%,
    var(--bg-2) 60%
  );
  --obtained-colour: #7d7397;
  --fed-colour: #4d7b6f;

  --radius: 11px;
  --radius-small: 7px;

  --card-border: 1px solid rgba(255, 255, 255, 0.1);
  --card-bg: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.1);
}

.success-celebration {
  position: fixed;
  left: 50%;
  top: max(78px, env(safe-area-inset-top));
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 28px);
  padding: 5px 16px 5px 5px;
  color: var(--bg-2);
  background: var(--gold);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.28),
    0 0 0 0 rgba(246, 213, 134, 0.55);
  font-weight: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -14px) scale(0.92);
  transition:
    opacity 160ms ease,
    transform 220ms cubic-bezier(0.2, 0.85, 0.3, 1);
}
.success-celebration.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  animation: success-celebration-pulse 700ms ease-out 1;
}
.success-celebration-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--bg-2);
  border-radius: 50%;
}
.success-celebration.is-character .success-celebration-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.success-celebration.is-critter .success-celebration-icon img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}
@keyframes success-celebration-pulse {
  0% {
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.28),
      0 0 0 0 rgba(246, 213, 134, 0.55);
  }
  65% {
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.28),
      0 0 0 13px rgba(246, 213, 134, 0);
  }
  100% {
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.28),
      0 0 0 0 rgba(246, 213, 134, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .success-celebration,
  .success-celebration.is-visible {
    animation: none;
    transition: opacity 100ms ease;
    transform: translate(-50%, 0);
  }
}
.confetti-canvas {
  display: none;
}

strong {
  color: var(--gold);
}

.flex-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

p a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--gold);

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #403a8a;
  background-attachment: fixed;
  overflow-x: hidden;
}

button {
  font: inherit;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 0.96;
  color: var(--gold);
  font-weight: 700;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.26);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1540px, 100% - 28px);
  padding: 0 0 1em;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100vh;
  max-width:940px;

  &:has(+ .app-menu) {
    padding: 0 0 118px;
  }
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}

.empty-state {
  padding: 0px 28px;
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);

  & b {
    text-transform: capitalize;
    color: var(--slot-color);
  }
}

.note {
  flex: 0 0 auto;
  margin: 1em;
  color: var(--muted);
  text-align: center;
  font-size: 13px;

  &.highlight {
    background-color: var(--bg-2);
    padding: 1em;
  }
}

/********************* NEW TOPBAR *********************/

.new-topbar {
  margin-bottom: 0px;
}

.new-topbar-nav {
  position: relative;
  left: 50%;
  display: flex;
  width: 100vw;
  min-height: 52px;
  align-items: stretch;
  justify-content: center;
  background: var(--bg-2);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 10px 28px rgba(3, 7, 35, 0.2);
  transform: translateX(-50%);
}

.new-topbar-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 10px;
  padding: 0 22px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: 0.18s ease;
  text-align: center;
  transition-property: color, background;
}

.new-topbar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.new-topbar-link[aria-current="page"] {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
}

.new-topbar-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 0;
  left: 22px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--gold);
}

.new-topbar-link:focus-visible {
  z-index: 1;
  outline: 2px solid var(--gold);
  outline-offset: -4px;
}

.new-topbar-link svg {
  width: 19px;
  height: 19px;
  min-width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.new-topbar-alert {
  display: flex;
  position: absolute;
  top: 100%;
  align-items: center;
  justify-content: center;
  margin-top: -7px;
  padding: 3px 5px;
  color: #2b2250;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 3px 10px rgba(246, 213, 134, 0.22);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  z-index: 1;
}

.new-page-heading {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 0 8px;
}

.closure-notice {
  margin: 12px 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(246, 213, 134, 0.4);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-small);
  background: rgba(246, 213, 134, 0.08);
  font-size: 13px;
  line-height: 1.6;
}

.closure-notice p {
  margin: 0;
}

.closure-notice p + p {
  margin-top: 8px;
}

.new-page-heading-eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.new-page-heading-title {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 0.96;
}
/*
@media (max-width: 620px) {
  .new-topbar-nav {
    min-height: 46px;
    justify-content: stretch;
    overflow-x: auto;
  }

  .new-topbar-link {
    flex: 1 0 auto;
    min-width: max-content;
    padding: 0 16px;
    font-size: 11px;
  }

  .new-topbar-link[aria-current="page"]::after {
    right: 16px;
    left: 16px;
  }

  .new-page-heading {
    padding-top: 22px;
  }

}*/

/********************* APP MENU AND FOOTER *********************/

.app-menu {
  position: fixed;
  left: 0;
  width: calc(100% - 14px);
  bottom: max(0px, env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 6px;
  padding: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: var(--bg-2);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-menu-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
  min-height: 68px;
  padding: 8px 12px;
  color: var(--muted);
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.app-menu-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.app-menu-button:active {
  transform: scale(0.97);
}

.app-menu-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.app-menu-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--gold);
}

.app-menu-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
}

.app-menu-count {
  position: absolute;
  top: -7px;
  left: 100%;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  color: #fff;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--slot-color);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.app-menu-label {
  max-width: 100%;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  margin-top: 2px;
  padding-bottom: 4px;
}

.footer-link {
  padding: 4px;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: rgba(201, 212, 255, 0.45);
  text-underline-offset: 3px;
}

.footer-link:hover {
  color: #fff;
  text-decoration-color: var(--gold);
}

.footer-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.footer-support {
  width: min(520px, calc(100% - 24px));
  margin: 14px auto 0;
  text-align: center;
}

.footer-support .buy-me-coffee-button {
  margin: 0 auto;
}

.update-support {
  margin-top: 12px;
}

/********************* CARDS AND HEADERS **********************/

.card {
  overflow: hidden;
  border-radius: var(--radius);
  border: var(--card-border);
  padding: 8px;
  background: var(--card-bg);
  margin: 1em 0;

  &.completed {
    background: var(--slot-color-faint);
  }
}

.card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  gap: 0px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border-width: medium;
  border-style: none;
  border-color: currentcolor;
  border-image: none;
  padding: 6px 10px;
  overflow: hidden;
  margin-bottom: 5px;
}

.card-header-label {
  grid-row: 1;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  letter-spacing: 0.01em;
  justify-content: start;
}

.card-header-detail {
  font-size: 0.6rem;
  color: var(--muted);
  flex-grow: 1;
  text-align: right;
}

/********************* ICON DEFAULTS *********************/

.image-icon {
  flex: 0 0 auto;
  display: block;
  position: relative;
  width: 16px;
  height: 16px;
  line-height: 1;
  overflow: hidden;
  --shadow-dist: -16px;
  --shadow-col: var(--text);

  .card-header &,
  .role-header &,
  .location-header &,
  .dashboard-role-toggle .toggle-set-button[aria-pressed="false"] & {
    --shadow-col: var(--muted);
  }

  .tile-badge & {
    --shadow-col: color-mix(in srgb, var(--grad-color, var(--bg)) 100%, var(--bg) 60%);
  }

  &.large {
    width: 22px;
    height: 22px;
    --shadow-dist: -22px;
  }

  &.small {
    width: 10px;
    height: 10px;
    --shadow-dist: -10px;
  }

  &.tiny {
    width: 8px;
    height: 8px;
    --shadow-dist: -8px;
  }

  .detail-fact &:not(.tiny) {
    display: inline-block;
    width: 1em;
    height: 1em;
    --shadow-dist: -1em;
    transform: translateY(2px);
  }

  & img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  &:not(.base-img) img {
    visibility: hidden;
  }

  &:not(.base-img)::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--shadow-col);
    -webkit-mask: var(--icon-src) center / contain no-repeat;
    mask: var(--icon-src) center / contain no-repeat;
  }
}

/********************* CLICKABLE CARDS DEFAULT STYLING *********************/
.clickable {
  --grad-color: var(--slot-color);

  &.ghost-button,
  &.obtained {
    --grad-color: var(--obtained-colour);
  }
  &.fed,
  &.ready {
    --grad-color: var(--fed-colour);
  }

  &.glow {
    --grad-color:var(--gold);
  }
}
.clickable {
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--grad-color) 100%, transparent 0%),
    color-mix(in srgb, var(--grad-color) 40%, transparent 12%)
  );
  border: 1px solid color-mix(in srgb, var(--grad-color) 58%, white 42%);
  box-shadow: none;
  overflow: hidden;
  transition: all 0.25s ease;
  color: #fff;
  cursor: pointer;
  font-size: var(--button-text);

  &:hover {
    filter: brightness(1.2);
  }
}

.primary-button,
.ghost-button {
  font-size: var(--button-text);
  padding: 8px 16px;
}

/*********************** FORM FIELDS *************************/

.form-box {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1em;
  margin-bottom: 1em;
  padding-top: 0.5em;

  &:has(+ &) {
    margin-bottom:0;
  }
}

.field-box {
  display: flex;
  flex-direction:row;
  gap:8px;
  position: relative;
  flex-shrink: 0;
  flex-grow: 1;
  min-width: 45%;
}

.character-filters {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.character-filters.universe-view > .field-box:last-child {
  display: none;
}

@media (max-width: 620px) {
  .form-box {
    flex-direction: column;
    align-items: stretch;
  }

  .form-box > .field-box {
    width: 100%;
    min-width: 0;
  }
}

.recipe-status-filter {
  flex-basis: 100%;
  width: 100%;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 0.6em;
  text-transform: uppercase;
  margin-top: -1.5em;
  margin-bottom: 2px;
}

/*** CHECKBOX ***/

.character-checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
}

.character-detail label:has(.character-checkbox-field input:disabled),
.character-detail label:has(.select-with-icon select:disabled) {
  opacity: 0.4;
}

.character-checkbox-field:has(input:disabled) {
  cursor: not-allowed;
  pointer-events: none;
}

.character-checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--grad-color);
}

.character-subgroup-field {
  width: fit-content;
  height: 39px;
  padding: 0 8px 0 5px !important;
  align-self: center;
}

/*** TOGGLE ***/

.toggle-set {
  display: flex;
  flex-wrap: nowrap;
  padding: 4px;
  border: var(--card-border);
  border-radius: 14px;
  background: var(--bg);
  gap: 3px;
  flex-grow: 1;
  flex-shrink: 0;
}

.role-toggle-set {
  margin-bottom: 1em;

  & .ready::before {
    display:block;
    width:10px;
    height:10px;
    content:" ";
    position:absolute;
    bottom:-5px;
    right:calc(50% - 5px);
    background:var(--fed-colour);
    border-radius:50%;
    z-index:3;
    border: 1px solid color-mix(in srgb, var(--grad-color) 58%, white 42%);
  }
}
.role-toggle-set .toggle-set-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 6px;
  position:relative;
  overflow:hidden;
}

.item-sort-heading {
  margin: 0;
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-align: center;

  & span {
    color:var(--gold);
  }
}

.toggle-set-button {
  font-size: var(--button-text);
  padding: 8px;
  transition: all 0.25s ease;
  flex-grow: 1;
  width: 1px;
  min-width: min-content;
}

.toggle-set-button:not(.clickable) {
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;

  &:hover {
    background: var(--slot-color-faint);
    border-color: var(--line);
  }
}

/*** SELECT ***/

.select-box {
  display: grid;
  gap: 4px;
  min-width: min(240px, 45%);
  flex-grow:1;
}

.select-box select {
  width: 100%;
  padding: 8px 36px 8px 12px;
}

.select-box option {
  color: #fff;
  background: var(--bg-3);
  border: var(--card-border);
  border-radius: var(--radius);
}

optgroup {
  background: var(--bg-2);
  color: var(--muted);
  font-weight: 400;
  font-style: italic;

  & option {
    font-style: normal;
  }
}

.select-box option:checked {
  color: var(--slot-color);
  font-style: italic;
}

.select-with-icon {
  position: relative;
  display: block;

  & select {
    padding: 8px 15px;
  }
}

.share-area-select-shell img[hidden] + select {
  padding-left: 12px;
}

/*** TABS ***/

.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.tab {
  cursor: pointer;
  border-radius: 0;
  font-size: 0.8rem;
  padding: 8px 2px;

  &:not(.clickable) {
    color: var(--text);
    background: transparent;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  &:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
  }
  &:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    border-right: 0;
  }
}

.tab-name {
  display: block;
}

.tab-label {
  display: block;
  font-size: 0.8em;
  color: var(--gold);
}

/*** STARS ***/

.stars-box {
  display: flex;
  flex-wrap: nowrap;
  padding: 4px;
  border: var(--card-border);
  border-radius: 14px;
  background: var(--bg);
  gap: 3px;
}

.stars {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  padding: 4px;
  border: var(--card-border);
  border-radius: 14px;
  background: var(--bg);
  gap: 3px;
  flex-grow: 1;
}

.stars button {
  height: 100%;
  aspect-ratio: 1 / 1;
  padding: 3px 4px 6px 4px;
  color: var(--slot-color);
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  opacity: 0.3;
  transition: all 0.18s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stars button.filled {
  color: var(--gold);
  opacity: 1;
}

.stars button:hover {
  filter: brightness(2);
  opacity: 1;
}

.stars button.active {
  color: var(--bg);
  background: var(--gold);
}

.stars button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/****************************************************************************************
  CRITTER TRACKER
****************************************************************************************/

/********************* Critter Schedule Styling *********************/

.schedule-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: var(--card-border);
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1em 0;
}

.schedule-scroll {
  position: relative;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.schedule-grid {
  position: relative;
  display: grid;
  grid-template-rows:
    auto
    auto
    calc(var(--hour-height) * 24)
    auto;

  &:has(.empty-state) {
    grid-template-columns: var(--time-col) repeat(1, auto) !important;
  }
}

.time-spacer {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  left: 0;
  z-index: 35;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}

.location-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: left;
  padding: 6px 10px;
  color: var(--text);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-row: 2;
  font-size: 9px;
  line-height: 1.15;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0;

  & .header-label {
    text-align: center;
    min-width: 0;
  }
}

.location-header.location-header-bottom {
  grid-row: 4;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.day-body {
  position: relative;
  grid-row: 3;
  min-height: calc(var(--hour-height) * 24);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--hour-height) - 1px),
      var(--line) calc(var(--hour-height) - 1px),
      var(--line) var(--hour-height)
    ),
    repeating-linear-gradient(
      to right,
      var(--bg) 0,
      var(--bg) calc(100% - 1px),
      rgba(255, 255, 255, 0.06) calc(100% - 1px),
      rgba(255, 255, 255, 0.06) 100%
    );
}

.time-axis {
  position: absolute;
  top: 0px;
  left: 0;
  z-index: 60;
  width: var(--time-col);
  min-height: calc(var(--hour-height) * 24);
  background: rgba(13, 19, 74, 0.96);
  border-right: 1px solid var(--line);
  pointer-events: none;
  will-change: transform;
}

.time-label {
  position: absolute;
  right: 12px;
  transform: translateY(-50%);
  font-size: 13px;
  white-space: nowrap;

  &:first-child {
    top: 11px !important;
  }

  &:last-child {
    top: calc(100% - 11px) !important;
  }
}

.column-lane {
  grid-row: 3;
  position: relative;
  min-height: calc(var(--hour-height) * 24);
  border-right: 1px solid var(--line);
}

.current-line {
  position: absolute;
  left: var(--time-col);
  width: calc(var(--schedule-width, 100%) - var(--time-col));
  height: 2px;
  background: var(--danger);
  z-index: 55;
  box-shadow: 0 0 12px rgba(255, 67, 94, 0.7);
  pointer-events: none;
}

.current-line-label {
  position: absolute;
  left: 8px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  transform: translateY(-11px);
  padding: 0 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--danger);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
  will-change: transform;
}

/********************* Critter Slot Styling *********************/

.critter-slot {
  position: absolute;
  left: 4px;
  right: 4px;
  min-height: 66px;
}

.critter-slot.fed::after,
.critter-slot.obtained::after {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
}

.critter-slot.fed::after {
  content: "✓ Fed";
  color: var(--grad-color);
  background: #fff;
}

.critter-slot.obtained::after {
  content: "✓ Obtained";
  color: #fff;
  background: color-mix(in srgb, var(--grad-color) 20%, var(--bg) 100%);
}

.critter-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: stretch;
  gap: 3px;
  width: 100%;
  padding: 6px 0px;
  color: #fff;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(var(--sticky-y, 0px));
  will-change: transform;
}

.critter-img {
  width: 52px;
  height: 43px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.34));
}

.critter-name {
  text-transform: uppercase;
  font-size: 10px;
  line-height: 1.06;
  text-align: center;
  transition: color 0.15s ease;
  padding: 3px 5px 0 5px;
}

.critter-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  font-size: 9px;
  line-height: 1.08;
  text-align: center;
  width: 100%;
}

.method {
  width: 100%;
  background: #ffffff80;
  color: var(--grad-color);
  font-style: italic;
  text-transform: uppercase;
  padding: 2px 0;
  font-size: 9px;
}

.slot-badges {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: flex;
  gap: 3px;
  pointer-events: none;
}

.slot-badge {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--grad-color) 20%, var(--bg) 100%);
  font-size: 10px;
  line-height: 1;
}

.critter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 45px);
  justify-content: start;
  padding: 0 1em 1em 1em;
  height: 100%;
  flex-grow: 1;
  gap: 8px;

  & .clickable {
    position: relative;
    width: 45px;
    height: 45px;
    padding:0;
  }
}

.critter-grid .clickable.obtained::after {
  display: block;
  position: absolute;
  top: 1px;
  left: 1px;
  z-index: 3;
  padding: 2px 3px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
  content: "✓";
  color: rgb(255, 255, 255);
  background: color-mix(in srgb, var(--grad-color) 20%, var(--bg) 100%);
}

.other-companions-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink:0;
}

.other-companions-view-toggle {
  flex-grow: 0;
  min-width: 100px;
}

.other-companion-name,
.hidden-critter-name {
  display: none;
}

.other-companion-grid-list,
.hidden-critter-grid-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;

  & .clickable {
    display: flex;
    align-items: center;
    width: 100%;
    height: 52px;
    padding: 4px 8px 4px 4px;
    gap: 8px;
    text-align: left;
  }

  & .critter-image {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
  }

  & .other-companion-name,
  & .hidden-critter-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 460px) {
  .modal-header:has(.other-companions-modal-actions) {
    gap: 8px;
    padding: 12px;
  }

  .modal-header:has(.other-companions-modal-actions) .modal-title {
    font-size: 20px;
  }

  .other-companions-modal-actions {
    gap: 6px;
  }

  .other-companions-view-toggle {
    padding: 3px;
    gap: 2px;
  }

  .other-companions-view-toggle .toggle-set-button {
    padding: 6px;
  }
}

.critter-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.critter-detail {
  display: grid;
  gap: 20px;
  align-items: start;
  padding-bottom: 0.5em;
}

.detail-list {
  display: grid;
  gap: 10px;
  color: #fff;
}

.detail-row {
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-label {
  display: grid;
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 12px;
  gap: 3px;
  justify-content: left;
  text-align: left;
  margin: 0;
  height: min-content;

  & + & {
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    padding-top: 0.75em;
  }

  .today & {
    color: var(--gold);
  }
}

.detail-value {
  display: flex;
  flex-direction: column;
  justify-content: start;
  gap: 1em;
  font-weight: normal;
  color: #fff;
  font-size: 12px;

  & i {
    opacity: 0.5;
    display: block;
  }
}

/*
 * Places the critter details above the still-open Obtained Critters modal.
 */
#critterModal.secondary-modal {
  z-index: 110;
}

/********************* Food Styling *********************/

.food {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0px;
  padding-top: 3px;
  color: #ffffff80;
  flex-wrap: wrap;
}

.food .small {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.food-additional-count {
  margin-left: 3px;
  white-space: nowrap;
}

.detail-food {
  display: inline-flex;
  align-items: center;
  justify-content: start;
  width: fit-content;
  gap: 3px;

  & .food-item {
    display: flex;
    gap: 0.5em;
    text-align: left;
  }
}

.detail-food-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.detail-inline-list {
  display: inline-flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 2px 6px;
}

.detail-inline-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.detail-symbol-icon {
  line-height: 1;
}

.slot-requirements {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 3px;
  padding: 4px 8px;
  color: #fff;
  background: var(--bg);
  border-radius: 99999px;
}

.slot-requirement {
  font-size: 1.3em;
}

/********************* Weekly Schedule Styling *********************/

.weekly-schedule-list {
  display: grid;
  gap: 0.45rem;
}

.weekly-schedule-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(5rem, 1fr) minmax(8rem, 1.4fr);
  align-items: center;
  gap: 0.75rem;
}

.weekly-schedule-row.today {
  background: var(--slot-color-faint);
  border-radius: 0.75rem;
  padding: 0.45rem 0.6rem;
}

.schedule-bar {
  position: relative;
  display: block;
  height: 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--slot-color) 50%, transparent 100%);
  overflow: hidden;
}

.schedule-bar-slot {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--slot-color, #386c54);
}

/****************************************************************************************
  CHARCTER TRACKER
****************************************************************************************/

/********************* Character Tile Styling *********************/

.role-group {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.role-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  gap: 7px;
  min-height: 0;
  padding: 3px 17px 3px 13px;
  margin-bottom: 1em;
  color: #fff;
  background: var(--bg);
  border-radius: 99999px;
  font-size: 13px;
  line-height: 1.15;
  text-align: left;
}

.role-header .header-label {
  text-align: left;
}

.role-none-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.44);
  border-radius: 50%;
  font-size: 10px;
}

.role-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 45px);
  justify-content: start;
  padding: 0 0.5em 1em 0.5em;
  height: 100%;
  flex-grow: 1;
  gap: 8px;
}

.character-tile {
  position: relative;
  width: 45px;
  height: 45px;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-small);
}

.character-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 10px;
  width: 100%;

  & > .role-header {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  & > .location-header {
    grid-column: 1 / -1;
    grid-row: auto;
    border-right: none;
  }

  & .clickable {
    display:flex;
    flex-direction:column;
    align-items: center;
    justify-content: start;
    gap:3px;
    padding:5px;
    text-align: center;
    position:relative;
    overflow: visible;

    &.ready::before {
      display: block;
      width: 50%;
      height: 10px;
      content: "Hunt";
      position: absolute;
      top: -5px;
      right: 25%;
      background: var(--fed-colour);
      border-radius: 8px;
      z-index: 3;
      padding: 2px 0px;
      border: 1px solid color-mix(in srgb, var(--grad-color) 58%, white 42%);
      line-height: 10px;
      text-transform: uppercase;
      font-size: 0.5rem;
    }
  }
}

.item-card-image {
  width:40px;
  height:40px;
  object-fit:contain;
  object-position: center;
}

.item-data-details {
  font-size:0.8em;
  color:color-mix(in srgb, var(--grad-color) 58%, white 42%);
}

.item-data-locations {
  font-size:0.7em;
  color:color-mix(in srgb, var(--grad-color) 45%, white 55%);

  & > span {
    display: block;
    border:0.5px solid color-mix(in srgb, var(--grad-color) 45%, white 55%);
    background:0.5px solid color-mix(in srgb, var(--grad-color) 45%, transparent 55%);
    padding:2px 6px;
    border-radius:0px;

    & + & {
      margin-top:0px;
      border-top:0px;
    }

    &:first-child {
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
    }

    &:last-child {
      border-bottom-left-radius: 5px;
      border-bottom-right-radius: 5px;
    }
  }
}

/************************** Character Drop Rates Styling **************************/

.drop-rates-intro,
.drop-rate-milestone-note {
  margin: 4px 4px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.drop-rate-list {
  display: block;
}

.drop-rate-milestones {
  margin-top: 12px;
  overflow: hidden;
  border: var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
}

.drop-rate-milestones-title {
  margin: 0;
  padding: 10px 12px;
  color: #fff;
  background: var(--bg);
  font-size: 13px;
}

.drop-rate-milestone-table-wrap {
  overflow-x: auto;
}

.drop-rate-milestone-table {
  width: 100%;
  border-collapse: collapse;
  color: #fff;
  font-size: 12px;
}

.drop-rate-milestone-table th,
.drop-rate-milestone-table td {
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  white-space: nowrap;
}

.drop-rate-milestone-table th {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 700;
}

.drop-rate-milestone-table td:first-child,
.drop-rate-milestone-table td:last-child {
  color: #fff8df;
  font-weight: 700;
}

.drop-rate-milestone-note {
  margin: 9px 12px 10px;
  font-size: 11px;
}

.drop-rate-role {
  overflow: hidden;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
}

.drop-rate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(18, 26, 82, 0.96);
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) - 3px) calc(var(--radius) - 3px) 8px 8px;
}

.drop-rate-character-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.drop-rate-role-name .header-icon {
  width: 22px;
  height: 22px;
}

.drop-rate-explanation {
  margin: 0;
  padding: 9px 12px;
  color: #fff8df;
  font-size: 11px;
  line-height: 1.45;
}

.drop-rate-characters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 7px;
  padding: 9px 6px 6px;
}

.drop-rate-character {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  height: auto;
  min-width: 0;
  padding: 0;
  color: #fff;
  text-align: left;
}

.drop-rate-character-image {
  position: relative;
  display: block;
  width: 45px;
  height: 100%;
  min-height: 45px;
  overflow: hidden;
  border-radius: 0;
  flex: 0 0 auto;
}

.drop-rate-character-details {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 5px 15px 5px 0;
}

.drop-rate-character-details strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-rate-character-details span,
.drop-rate-empty {
  color: var(--muted);
  font-size: 10px;

  & i {
    color: #fff;
  }
}

.drop-rate-empty {
  grid-column: 1 / -1;
  margin: 5px;
}

@media (max-width: 520px) {
  .drop-rate-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .drop-rate-characters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/********************* Character Styling *********************/

.tile-badge {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.38);
}

.tile-badge svg {
  width: 10px;
  height: 10px;
  object-fit: contain;
}

.tile-badge svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.role-badge {
  top: 0;
  right: 0;
  border-radius: 0 0 0 50%;
  border-top: none;
  border-right: none;
  background: color-mix(in srgb, var(--grad-color, var(--slot-color)) 58%, white 42%);
  border: 1px solid color-mix(in srgb, var(--grad-color, var(--slot-color)) 58%, white 42%);
}

.level-badge {
  border-radius: 0 50% 0 0;
  bottom: 0;
  left: 0;
  color: var(--gold);
  font-size: 9px;
  border-bottom: none;
  border-left: none;
  border-color: color-mix(in srgb, var(--slot-color) 58%, white 42%);
  background: color-mix(in srgb, var(--grad-color, var(--bg)) 80%, var(--bg) 100%);
}

.item-badge {
  border-radius: 50% 0 0 0;
  bottom: 0;
  right: 0;
  color: var(--gold);
  font-size: 9px;
  border-bottom: none;
  border-right: none;
  border-color: color-mix(in srgb, var(--slot-color) 58%, white 42%);
  background: color-mix(in srgb, var(--grad-color, var(--bg)) 58%, var(--bg) 42%);
}

.realm-empty {
  margin: 0;
  padding: 8px 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.6rem;
}

#characterModal.secondary-modal {
  z-index: 110;
}

.character-detail-fields {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: start;
  min-width: 0;
}

.character-detail-fields > .character-field {
  grid-column: 1 / -1;
}

.character-detail-controls {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.character-milestones {
  display: flex;
  gap: 0em;
  flex-direction: column;
}

.character-notable-companions {
  border-block: 1px solid var(--line);
  padding: 1em 0;
}

.character-section-title {
  margin: 0 0 0.75em;
  font-size: 0.95rem;
}

.character-notable-companion-grid {
  padding: 0;
}

.character-milestone {
  min-width: 0;
  transition: opacity 0.2s ease;
  border-block: 1px solid var(--line);
  padding: 1em 0;

  &:first-child {
    border-block-start: none;
    padding-top:0;
  }

  &:last-child {
    border-block-end: none;
    padding-bottom:0;
  }
}

.character-milestone:not(.reached, .character-notable-companions) {
  opacity: 0.4;
  pointer-events: none;
}

.character-milestone-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.character-milestone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.character-milestone-level {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.character-milestone-control {
  min-width: 0;
  margin-top: 4px;
}

.character-milestone-control .select-box {
  min-width: 0;
}

.character-milestone-control .character-checkbox-field {
  padding: 4px 0;
}

.character-item-assist-content {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.item-assist-pending-note {
  display: block;
  margin: 8px 8px 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.best-friends-glow-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.character-milestone-control .character-shared-house {
  margin-top: 6px;
}
/***
@media (max-width: 560px) {
  .character-detail-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
  ***/

.character-schedule {
  min-width: 0;
  background: transparent;
  border: none;
}

.character-dream-styles {
  grid-column: 1 / -1;
  min-width: 0;
}
.dream-style-list {
  display: grid;
  gap: 6px;
}
.dream-style-row {
  display: grid;
  grid-template-columns: 18px 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: var(--card-border);
  border-radius: var(--radius);
  cursor: pointer;
}
.dream-style-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--grad-color);
}
.dream-style-row img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}
.dream-style-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.dream-style-copy strong {
  font-size: 0.78rem;
}
.dream-style-copy small {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.3;
}
.dream-style-default {
  cursor: not-allowed;
}

.character-wiki-link {
  display: inline-block;
}

.character-schedule-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.character-schedule-scroll {
  overflow-x: auto;
  padding: 0 4px 10px;
}

.character-schedule-timeline {
  display: flex;
  gap: 8px;
  padding-top: 22px;
}

.character-schedule-hours {
  position: relative;
  height: 480px;
  flex: 0 0 24px;
  color: var(--muted);
  font-size: 10px;
}

.character-schedule-hours span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
}

.character-schedule-hours span:first-child {
  transform: none;
}
.character-schedule-hours span:last-child {
  transform: translateY(-100%);
}

.character-schedule-day {
  position: relative;
  flex: 1 0 85px;
  min-width: 0;
}

.character-schedule-day-label {
  position: absolute;
  bottom: 100%;
  width: 100%;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
}

.character-schedule-track {
  position: relative;
  height: 480px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line) 0 1px,
    transparent 1px calc(100% / 12)
  );
}

.character-schedule-slot {
  position: absolute;
  inset-inline: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid var(--bg-2);
  border-radius: var(--radius-small);
  padding: 3px;
  background: var(--slot-color);
  color: var(--text);
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.character-schedule-slot-home {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.character-schedule-slot-unknown {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(246, 213, 134, 0.45);
  color: var(--gold);
}

.character-schedule-slot-wandering {
  background: color-mix(in srgb, var(--slot-color) 10%, transparent);
  border-color: var(--line);
}

.character-schedule-now {
  position: absolute;
  left: -4px;
  right: -4px;
  height: 2px;
  background: var(--danger);
  z-index: 1;
  pointer-events: none;
}

.character-schedule-now::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.character-field {
  grid-template-columns: 1fr;
  border: none;
  background: transparent;
  padding: 0;
}

.character-level-toggle {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  width: 100%;
}

.character-level-toggle .toggle-set-button {
  width: auto;
  min-width: 0;
  min-height: 48px;
  padding: 6px 4px;
}

.character-level-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-level-label {
  font-weight: 700;
}

.character-detail-header-content {
  display: flex;
  flex-direction:column;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0px;
  min-width: 0;
}

.character-achievements {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
}

.character-achievement {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0.5;
}

.character-achievement.achieved {
  opacity: 1;
}

.character-achievement-icon {
  display: inline-grid;
  width: 14px;
  place-items: center;
  color: currentColor;
  font-size: 13px;
  line-height: 1;
}

.character-achievement small {
  color: inherit;
  font-size: 9px;
  font-weight: 600;
}

@media (max-width: 560px) {
  .character-detail-header-content {
    align-items: center;
    flex-direction: column;
    gap: 6px;
  }

  .character-achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
  }
}

.character-role-location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.character-house-location-field {
  order: -1;
}

.select-with-icon {
  display: flex;
  align-items: center;
  gap: 7px;
}

.character-shared-house {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.character-shared-house-label {
  color: var(--muted);
  opacity: 0.7;
  font-size: 10px;
}

.character-shared-house-tiles {
  padding: 0;
  height: auto;
}

.select-with-icon select {
  min-width: 0;
  width: 100%;
}

.select-with-icon select:disabled {
  opacity: 1;
  color: #fff;
  background: var(--bg-3);
}

.select-with-icon > .role-none-icon {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  aspect-ratio: 1 / 1;
}

.character-drop-rate-explanation {
  margin: 7px 0 0 0;
  color: #fff8df;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
}

.select-with-icon .header-icon,
.select-with-icon .role-none-icon {
  width: 24px;
  height: 24px;
}

/****************************************************************************************
  RECIPE TRACKER
****************************************************************************************/

/********************* Recipe Tracker Styling *********************/

.recipe-results {
  font-size: 0.6rem;
  color: var(--muted);
  display: block;
  margin: 0;
  text-align: center;
}

.recipe-result-pill {
  padding: 0 5px;
  background: var(--bg-3);
  outline: 2px solid var(--bg-3);
  border-radius: 3px;
  display: inline-block;
  margin: 0 3px;
}

.recipe-tracker {
  min-height: 220px;
}

.recipe-list {
  display: grid;
  gap: 7px;
  margin: 1em 0;
}

.recipe-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 80px 38px;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px 8px 6px;
}

.recipe-row-image {
  display: block;
  width: 60px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.32));
}

.recipe-row-name {
  display: block;
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  font-size: 16px;
  line-height: 1.15;
}

.recipe-row-content {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.recipe-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.recipe-row-meta > * + * {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 11px;
  height: 100%;
}

.recipe-row-energy,
.recipe-detail-fact strong {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-row-energy {
  color: #fff8df;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  width: fit-content !important;

  & img {
    width: 1em;
    height: 1em;
  }
}

.recipe-row-stars {
  overflow: hidden;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.recipe-row-stars::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.24);
}

.recipe-row-energy span:not(.image-icon) > img,
.recipe-detail-fact span:not(.image-icon) > img,
.detail-fact span:not(.image-icon) > img {
  display: inline-block;
  width: 1em;
  height: 1em;
  object-fit: contain;
  transform: translate(0px, 2px);
}

.recipe-row-ingredients {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  margin-left: auto;
  width: 80px;
  flex-wrap: wrap;
}

.recipe-ingredient {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.recipe-ingredient.compact {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.recipe-ingredient.compact img {
  width: 100%;
  height: 100%;
}

.recipe-ingredient-options {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.recipe-ingredient-options
  .recipe-ingredient.compact
  + .recipe-ingredient.compact {
  margin-left: -13px;
}

.recipe-ingredient-options small {
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  margin-left: -8px;
  padding: 0 4px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(13, 19, 74, 0.94);
  font-size: 9px;
  font-weight: 800;
}

.recipe-obtained-check {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  cursor: pointer;
}

.recipe-obtained-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.recipe-obtained-check span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 7px;
  background: rgba(13, 19, 74, 0.32);
}

.recipe-obtained-check input:checked + span {
  border-color: color-mix(in srgb, var(--grad-color) 20%, var(--bg) 100%);
  background: var(--grad-color);
}

.recipe-obtained-check input:checked + span::after {
  content: "✓";
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.recipe-obtained-check input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.recipe-modal {
  width: min(680px, 100%);
}

.recipe-detail {
  padding: 4px;
}

.recipe-detail-facts,
.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  align-items: start;
}

.recipe-detail-fact,
.detail-fact {
  display: grid;
  grid-template-columns: minmax(82px, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 2px;
}

.recipe-detail-fact > span,
.detail-fact > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.recipe-detail-fact strong,
.detail-fact strong {
  min-width: 0;
  color: #fff;
  font-size: 12px;
}

.critter-location-value {
  display: grid;
  gap: 2px;
}

.critter-location-value small {
  color: var(--muted);
  font-size: 10px;
  font-style: italic;
  font-weight: 600;
}

.requirement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.requirement-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.recipe-stars {
  color: var(--gold);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.recipe-detail-ingredients {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.recipe-detail-ingredients h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.recipe-detail-ingredients > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.recipe-detail-ingredients .recipe-ingredient,
.recipe-detail-ingredients .recipe-ingredient-options {
  padding: 6px 9px;
  color: #fff;
  font-size: 12px;
}

.recipe-detail-ingredients .recipe-ingredient-options {
  flex-wrap: wrap;
  gap: 6px;
}

.recipe-detail-ingredients .recipe-ingredient-options::before {
  content: "Choose one:";
  width: 100%;
  color: var(--muted);
  font-size: 10px;
}

.recipe-page .app-menu {
  grid-template-columns: minmax(120px, 190px);
  justify-content: center;
}

@media (max-width: 760px) {
  .recipe-page {
    background-attachment: scroll;
  }

  .new-topbar,
  .app-menu {
    background: var(--bg-2);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .recipe-page .recipe-row-image {
    filter: none;
  }

  .recipe-filters {
    grid-template-columns: 1fr 1fr;
  }

  .recipe-status-filter {
    grid-column: 1 / -1;
  }

  .recipe-row-image {
    width: 52px;
    height: 52px;
  }

  .recipe-row-name {
    font-size: 14px;
  }

  .recipe-row-stars {
    font-size: 11px;
  }

  .recipe-row-meta {
    gap: 7px;
  }

  .recipe-row-meta > * + * {
    padding-left: 8px;
  }

  .recipe-detail-facts,
  .detail-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .recipe-filters {
    grid-template-columns: 1fr;
  }

  .recipe-status-filter {
    grid-column: auto;
  }
}

/****************************************************************************************
  OBTAINED / LISTS
****************************************************************************************/

.unlocked-group {
  overflow: hidden;
  padding: 0;

  & .card-header {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
}

.card-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 4px;
  color: var(--gold);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.card-summary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.card-title {
  display: block;
  margin: 0;
  overflow: hidden;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-progress {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.2;

  .completed & {
    color: color-mix(in srgb, var(--muted) 100%, var(--slot-color) 100%);
    font-style: italic;
  }
}

.card-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 27px;
  padding: 4px 8px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.card-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transform-origin: center;
  transition: transform 0.18s ease;
}

.card[open] .card-chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.unlocked-group-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}

.card-summary-body {
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.unlocked-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px;
}
.unlocked-row.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}
.unlocked-row.unavailable small {
  display: block;
  font-size: 0.75rem;
}
.unlocked-subgroup {
  grid-column: 1 / -1;
  margin: 1rem 0 0.35rem;
  font-size: 0.9rem;
}
.unlocked-subgroup small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
}
.floating-island-group {
  margin-top: 1rem;
}
.floating-island-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8em;
  font-style: italic;
  padding: 0 1em;
}

.unlocked-row input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--grad-color);
}

.unlocked-row-content {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size:var(--button-text);
}

.unlocked-row-content .header-icon {
  width: 20px;
  height: 20px;
}

/****************************************************************************************
  MODALS
****************************************************************************************/

.modal-backdrop {
  position: fixed;
  inset: 0;
  top: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0px;
  background: rgba(3, 8, 36, 0.62);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  width: min(560px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(
    180deg,
    rgba(44, 53, 134, 0.98),
    rgba(17, 24, 83, 0.98)
  );
  box-shadow: var(--shadow);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(36, 45, 122, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.modal-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--gold);
  font-size: 26px;
  line-height: 1.1;
}

.modal-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

.close-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding-bottom: 5px;
}

.modal-body {
  padding: 10px;

  & > p:first-child {
    margin-top: 0;
  }
}

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

.backup-actions {
  justify-content: flex-start;
}

.danger-button.clickable {
  --grad-color: var(--danger);
}

.erase-progress-button {
  margin-left: auto;
}

.settings-backup-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--gold);
  font-size: 13px;
}

/********************* Detail Modal Shell *********************/

.detail-modal {
  display: flex;
  flex-direction: column;
  width: min(680px, calc(100% - 2rem));
  overflow: hidden;
  max-height: calc(100dvh - 24px);
}

.detail-modal-header {
  position: relative;
  flex: 0 0 auto;
  justify-content: flex-start;
  min-height: 0px;
  padding: 12px 18px;
}

.modal-header-critters,
.modal-header-characters {
  flex-direction: column;
  min-height: 128px;
  overflow: hidden;
  isolation: isolate;
  background: rgba(14, 22, 78, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.22);
}

.modal-header-critters-background,
.modal-header-characters-background {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.5;
  filter: blur(3px);
}

.modal-header-critters::after,
.modal-header-characters::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 35%, rgba(44, 53, 134, 0.98));
  pointer-events: none;
}

.detail-modal-header-image {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.42));
}

.modal-header-critters .detail-modal-header-image,
.modal-header-characters .detail-modal-header-image {
  position: relative;
  z-index: 1;
  width: auto;
  min-width: 100px;
  height: 100px;
  filter: drop-shadow(0px 0px 30px rgba(255, 255, 255, 1));
}

.detail-modal-header .modal-title {
  min-width: 0;
  overflow-wrap: anywhere;
  width: 100%;
  text-align: center;
}

.modal-header-critters .modal-title,
.modal-header-characters .modal-title {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(8, 12, 45, 0.72);
}

.detail-modal-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-modal-actions {
  position: sticky;
  bottom: -10px;
  z-index: 3;
  flex: 0 0 auto;
  justify-content: flex-end;
  margin: auto -10px -10px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 24, 83, 0.9);
  box-shadow: 0 -12px 24px rgba(7, 12, 58, 0.18);
  backdrop-filter: blur(14px);
}

.detail-modal-actions .primary-button,
.detail-modal-actions .ghost-button {
  min-width: 110px;
}

@media (max-width: 560px) {

  .detail-modal-actions {
    flex-wrap: nowrap;
  }

  .detail-modal-actions .primary-button,
  .detail-modal-actions .ghost-button {
    min-width: 0;
  }
}

/********************* ABOUT MODAL *********************/

.about-content {
  display: grid;
  gap: 16px;
  padding: 12px;
  color: var(--text);
  line-height: 1.65;
}

.about-content p {
  margin: 0;
}

.about-introduction {
  color: #fff;
  font-size: 16px;
}

.about-features {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 14px 14px 34px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.about-signoff {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.about-support {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 221, 0, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 221, 0, 0.08);
  font-size: 0.8rem;

  & em {
    color: var(--gold);
  }

  & p {
    margin: 0;
  }
}

.buy-me-coffee-button {
  --grad-color: var(--gold);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  padding: 10px 16px;
  color: white !important;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  background: color-mix(in srgb, var(--gold) 100%, transparent 20%);
  border: 1px solid color-mix(in srgb, var(--grad-color) 58%, white 42%);

  &:hover {
    color: var(--bg) !important;
    filter: brightness(1);
    background: var(--gold);
  }
}

.buy-me-coffee-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.about-disclaimer {
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

/********************* UPDATES AND ONBOARDING *********************/

.updates-modal {
  width: min(660px, calc(100% - 28px));
}

.updates-list {
  display: grid;
  gap: 0;
}

.update-entry {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-soft);
}

.update-entry:first-child {
  padding-top: 4px;
}

.update-entry:last-child {
  padding-bottom: 4px;
  border-bottom: 0;
}

.update-date {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: normal;
  white-space: pre-line;
  text-align: center;
}

.update-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.update-description > :first-child {
  margin-top: 0;
}

.update-description > :last-child {
  margin-bottom: 0;
}

.update-description p {
  margin: 0 0 12px;
  color: #fff;
}

.update-description h3,
.update-description h4,
.update-description h5 {
  margin: 18px 0 8px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
}

.update-description h3 {
  font-size: 19px;
}

.update-description h4 {
  font-size: 17px;
}

.update-description h5 {
  font-size: 15px;
}

.update-description ul,
.update-description ol {
  margin: 0 0 14px;
  padding-left: 22px;

  & li::marker {
    color: var(--gold);
  }
}

.update-description li + li {
  margin-top: 5px;
}

.update-description strong,
.update-description em {
  color: var(--gold);
}

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

.update-description a:hover {
  color: #fff;
}

.update-description code {
  padding: 2px 5px;
  color: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-family: Consolas, Monaco, monospace;
  font-size: 0.9em;
}

.updates-empty {
  margin: 0;
  padding: 20px 0;
  color: var(--muted);
  text-align: center;
}

.onboarding-steps {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  counter-reset: onboarding-step;
}

.onboarding-steps b {
  color: var(--gold);
}

.onboarding-steps li {
  position: relative;
  display: grid;
  gap: 0.25rem;
  padding-left: 3rem;
  counter-increment: onboarding-step;
}

.onboarding-steps li::before {
  content: counter(onboarding-step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 2rem;
  height: 1rem;
  place-items: center;
  border-radius: 50%;
  color: var(--slot-color);
  font-weight: 700;
}

.onboarding-steps strong {
  font-size: 1rem;
}

.onboarding-steps span {
  color: var(--muted);
}

/****************************************************************************************
  STYLE GUIDE
****************************************************************************************/

.styleguide-section-header {
  margin: 32px 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, rgba(246, 213, 134, 0.12), transparent);
}

.styleguide-section-header .eyebrow {
  margin: 0 0 4px;
}
