.page {
  width: var(--page);
  margin-inline: auto;
  padding: 2.5rem 0 5rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

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

p.hint {
  margin-top: 0.6rem;
}

.guilds + .hint {
  margin-top: 1.6rem;
}

.hint a {
  font-weight: 800;
}

.guild-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--lime);
  font-size: 1.4rem;
  font-weight: 800;
  object-fit: cover;
}

.guild-icon.round {
  border-radius: 50%;
}

.panel {
  padding: 1.5rem;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--white);
}

.panel h2,
.side-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  font-size: 1.55rem;
}

.side-title {
  margin-bottom: 0.9rem;
}

.panel h2 i,
.side-title i {
  font-size: 1.5rem;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.empty h2 {
  margin: 0.5rem 0 0;
}

.empty p {
  max-width: 28rem;
  margin: 0 0 0.8rem;
  color: var(--muted);
}

.guilds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guild-card {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--white);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.guild-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.guild-card strong {
  display: block;
  overflow: hidden;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-card small {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.guild-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
  gap: 1.75rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.field > label {
  font-weight: 800;
}

select,
input[type='text'] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 700 1rem var(--font-body);
}

select {
  padding-inline-end: 2.4rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%2317301a' d='M213.7 101.7l-80 80a8 8 0 01-11.4 0l-80-80a8 8 0 0111.4-11.4L128 164.7l74.3-74.4a8 8 0 0111.4 11.4z'/%3E%3C/svg%3E");
  background-position: right 0.9rem center;
  background-repeat: no-repeat;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--rind);
}

.range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.2rem;
  align-items: center;
  gap: 0.8rem;
  font-weight: 800;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  border-top: 2px dashed #c5d78a;
  cursor: pointer;
}

.switch strong {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.switch small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch input {
  position: relative;
  flex: none;
  width: 3.2rem;
  height: 1.85rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #e2e8c7;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.switch input::after {
  position: absolute;
  top: 50%;
  left: 0.22rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--ink);
  content: '';
  translate: 0 -50%;
  transition: left 0.15s ease;
}

.switch input:checked {
  background: var(--lime);
}

.switch input:checked::after {
  left: calc(100% - 1.37rem);
  background: var(--rind);
}

.switch-block {
  margin-bottom: 1.5rem;
  border-bottom: 2px dashed #c5d78a;
}

.switch-block .field {
  margin-bottom: 1.1rem;
}

.deck {
  padding: 1.5rem;
  border: 2px solid var(--ink);
  border-radius: 26px;
  background: var(--forest);
  color: var(--lime);
  box-shadow: 8px 8px 0 var(--ink);
}

.deck h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 800;
}

.deck-idle {
  padding: 0.8rem 0 0.4rem;
  text-align: center;
}

.deck-idle img {
  margin: 0 auto 0.75rem;
  width: 8rem;
}

.deck-idle h2 {
  color: #f3f9d4;
  font-size: 1.7rem;
}

.deck-idle p {
  max-width: 25rem;
  margin: 0.5rem auto 0;
  color: #cfe39a;
}

.deck-top {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
}

.deck-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 8.5rem;
  height: 8.5rem;
  overflow: hidden;
  border: 2px solid var(--lime);
  border-radius: 18px;
  background: var(--melon);
  color: var(--lime);
  font-size: 3rem;
}

.deck-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-where {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  color: #bcd37a;
  font-size: 0.9rem;
  font-weight: 800;
}

.deck-title {
  margin: 0 0 0.25rem;
  color: #f3f9d4;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  overflow-wrap: anywhere;
}

.deck-artist {
  margin: 0;
  color: #cfe39a;
}

.deck-by {
  margin: 0.4rem 0 0;
  color: #9fb868;
  font-size: 0.9rem;
}

.deck-time {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0 1rem;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.deck-time span:last-child {
  text-align: end;
}

.bar {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(209, 232, 128, 0.22);
}

.fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--lime);
}

.deck-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.ctl {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--lime);
  font-size: 1.45rem;
  cursor: pointer;
}

button.ctl:hover {
  background: rgba(209, 232, 128, 0.16);
}

.ctl[aria-pressed='true'] {
  background: var(--lime);
  color: var(--forest);
}

.ctl-main {
  width: 4.25rem;
  height: 4.25rem;
  border-color: var(--ink);
  background: var(--melon);
  color: var(--ink);
  font-size: 2rem;
  box-shadow: 0 4px 0 var(--ink);
}

button.ctl-main:hover {
  background: #ff826f;
}

.deck-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1rem;
  margin-top: 1.3rem;
}

.volume {
  display: flex;
  flex: 1 1 11rem;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
}

.volume input {
  accent-color: var(--lime);
}

.volume output {
  min-width: 2.8rem;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.ctl-text {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 2px solid rgba(209, 232, 128, 0.45);
  border-radius: 999px;
  background: transparent;
  color: var(--lime);
  font: 800 0.92rem var(--font-body);
  cursor: pointer;
}

.ctl-text:hover {
  border-color: var(--lime);
}

.ctl-small {
  margin-inline-start: auto;
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
}

.deck-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.deck-add input[type='text'] {
  flex: 1 1 12rem;
  width: auto;
}

.deck-add select {
  flex: 0 1 9.5rem;
  width: auto;
}

.deck-add input[type='text'],
.deck-add select {
  border-color: rgba(209, 232, 128, 0.45);
  background-color: #173a16;
  color: #f3f9d4;
}

.deck-add select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%23d1e880' d='M213.7 101.7l-80 80a8 8 0 01-11.4 0l-80-80a8 8 0 0111.4-11.4L128 164.7l74.3-74.4a8 8 0 0111.4 11.4z'/%3E%3C/svg%3E");
}

.deck-add ::placeholder {
  color: #9fb868;
}

.deck-queue {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(209, 232, 128, 0.25);
}

.deck-queue h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.deck-queue h3 span:not(.ctl-small) {
  color: #9fb868;
}

.deck-hint {
  margin: 0.4rem 0 0;
  color: #9fb868;
}

.queue {
  display: grid;
  gap: 0.15rem;
  max-height: 22rem;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.queue li {
  display: grid;
  grid-template-columns: 1.6rem 2.6rem minmax(0, 1fr) auto 2rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.3rem;
  border-radius: 12px;
}

.queue li:hover {
  background: rgba(209, 232, 128, 0.1);
}

.queue .thumb {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  background: var(--melon);
  color: var(--lime);
  object-fit: cover;
}

.queue .meta {
  display: grid;
  min-width: 0;
}

.queue .t,
.queue .a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue .t {
  color: #f3f9d4;
  font-weight: 800;
}

.queue .a,
.queue .n,
.queue .len {
  color: #aac26c;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.queue .drop {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #aac26c;
  font-size: 1.15rem;
  cursor: pointer;
}

.queue .drop:hover {
  color: var(--melon);
}

.count {
  margin-inline-start: auto;
  padding: 0.1rem 0.65rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--lime);
  font: 800 0.9rem var(--font-body);
  font-style: normal;
}

.fav-add {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

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

.fav {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
}

.fav .thumb {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 12px;
  background: var(--melon);
  color: var(--lime);
  font-size: 1.6rem;
  object-fit: cover;
}

.fav-meta {
  display: grid;
  min-width: 0;
}

.fav-meta strong,
.fav-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-meta a {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
}

.fav-meta a:hover strong {
  text-decoration: underline;
}

.fav-meta small {
  color: var(--muted);
  font-weight: 700;
}

.fav-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font-size: 1.25rem;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--lime);
}

.toasts {
  position: fixed;
  inset: auto 0 1.25rem;
  z-index: 50;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 0 1rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.1rem;
  border-radius: 14px;
  background: var(--ink);
  color: var(--lime);
  font-weight: 800;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
  animation: toast-in 0.2s ease-out;
}

.toast.error {
  background: var(--melon);
  color: var(--ink);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (max-width: 960px) {
  .guild-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .deck-top {
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 1rem;
  }

  .deck-art {
    width: 6rem;
    height: 6rem;
    font-size: 2.2rem;
  }

  .fav {
    grid-template-columns: 3.2rem minmax(0, 1fr);
  }

  .fav .thumb {
    width: 3.2rem;
    height: 3.2rem;
  }

  .fav-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}
