:root {
  color-scheme: light;
  --bg: #fff6e7;
  --bg-2: #ffe2b8;
  --glow-1: #fff3cf;
  --glow-2: #ffc885;
  --surface: rgb(255 253 247 / 0.78);
  --surface-strong: #fffaf1;
  --line: #ebcfaa;
  --line-soft: rgb(210 154 93 / 0.24);
  --text: #2f2418;
  --muted: #8c7156;
  --accent: #d9782d;
  --accent-strong: #a74617;
  --success: #426d4f;
  --shadow: 0 14px 34px rgb(142 83 24 / 0.12);
  --bar-bg: rgb(255 248 235 / 0.82);
  --control-bg: rgb(255 255 255 / 0.54);
  --control-bg-hover: rgb(255 255 255 / 0.74);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, var(--glow-1) 0 18rem, transparent 34rem),
    radial-gradient(circle at 88% 0, var(--glow-2) 0 14rem, transparent 30rem),
    linear-gradient(145deg, var(--bg), var(--surface-strong) 48%, var(--bg-2));
  color: var(--text);
  font-family: "Aptos Rounded", "Nunito", "SF Pro Rounded", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: -0.01em;
}

button,
input,
a,
select {
  font: inherit;
}

button,
a,
input,
select {
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: var(--text);
}

button,
a {
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button {
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

button:hover,
a:hover,
select:hover,
button.active {
  border-color: var(--accent);
  background: var(--control-bg-hover);
  color: var(--accent-strong);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.lucide {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: var(--icon-fill, none);
  flex: 0 0 auto;
}

.icon-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bar-bg);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
}

.brand {
  color: var(--accent-strong);
  font-size: 1.4rem;
  font-weight: 850;
  letter-spacing: -0.05em;
}

#paletteSelect {
  max-width: 138px;
  height: 30px;
  padding: 0 28px 0 10px;
  border-radius: 999px;
  color: var(--muted);
  background-color: var(--control-bg);
  font-size: 0.82rem;
}

#paletteSelect option {
  background: var(--surface-strong);
  color: var(--text);
}

.bar span {
  color: var(--muted);
  white-space: nowrap;
}

.bar b,
.claimant,
.name,
.claim-btn:not(:disabled) {
  color: var(--accent-strong);
}

.bar button,
.bar a,
.bar input,
.bar select,
#toggleAllBtn,
.claim-btn,
.save-btn {
  border-radius: 999px;
}

.bar button,
.bar a,
.bar input {
  height: 34px;
  padding: 0 12px;
}

.bar a {
  display: inline-flex;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  padding-inline: 0 !important;
}

.icon-btn .lucide {
  width: 15px;
  height: 15px;
}

#myBtn {
  width: auto;
  min-width: 48px;
  padding-inline: 9px !important;
}

#favoriteCount {
  min-width: 1.2em;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 760;
}

#characterInput {
  flex: 0 1 150px;
  width: clamp(112px, 11vw, 150px);
  margin-left: auto;
}

#searchInput {
  flex: 1 1 280px;
  width: min(420px, 30vw);
  max-width: 520px;
}

input::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, white);
}

main {
  max-width: 1920px;
  margin: 0 auto;
  padding: 16px 18px 42px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.status {
  color: var(--muted);
  font-size: 0.92rem;
}

#toggleAllBtn {
  min-height: 32px;
  padding: 4px 12px;
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 8px;
  align-items: start;
}

.spawn {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.spawn.open {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: var(--surface-strong);
}

.spawn-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
}

.summary-btn {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.summary-btn:hover {
  transform: none;
}

.title {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.title-main {
  display: flex;
  align-items: center;
  min-width: 0;
}

.chev,
.area,
.time-sub,
.empty {
  color: var(--muted);
}

.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 820;
}

.area {
  overflow: hidden;
  padding-left: 18px;
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.claim-btn,
.save-btn {
  min-height: 26px;
  padding: 2px 8px;
  font-size: 0.78rem;
}

.claim-btn {
  width: 29px;
  padding-inline: 0;
}

.claim-btn .lucide {
  width: 14px;
  height: 14px;
}

.claim-btn:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--control-bg-hover) 70%, var(--accent));
  color: var(--accent-strong);
  font-weight: 780;
}

.save-btn {
  width: 29px;
  padding-inline: 0;
  overflow: hidden;
  color: var(--muted);
}

.save-btn .lucide {
  width: 13px;
  height: 13px;
}

.save-btn svg + * {
  display: none;
}

.chev {
  display: inline-flex;
  width: 1em;
  margin-right: 4px;
  vertical-align: -0.12em;
}

.rows {
  display: none;
  padding: 0 8px 7px 24px;
}

.spawn.open .rows {
  display: block;
}

.row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 5px;
  min-height: 26px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  font-size: 0.68rem;
  line-height: 1.12;
}

.time-stack {
  display: grid;
  gap: 1px;
  color: var(--muted);
}

.time-stack span:first-child {
  color: var(--text);
  font-weight: 720;
}

.claimant {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
  font-weight: 760;
}

.claimant:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.empty {
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(760px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .bar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  #characterInput {
    margin-left: 0;
  }

  .brand-wrap {
    width: 100%;
  }

  #paletteSelect {
    max-width: none;
  }

  #searchInput,
  #characterInput {
    width: 100%;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .list {
    grid-template-columns: 1fr;
  }

  .spawn-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .save-btn {
    display: none;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 5px 0;
  }
}
