/* ===== Quest board ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.quest-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.quest {
  --bc: var(--line);
  position: relative;
  list-style: none;
  padding: 12px 12px 10px 14px;
  background: var(--panel);
  filter: drop-shadow(5px 5px 0 rgba(0, 0, 0, 0.55));
  animation: card-in 0.36s steps(5) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  overflow: hidden;
}

.quest::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--panel-3);
}

.quest.is-mine {
  background: color-mix(in srgb, var(--pc) 20%, var(--panel));
}

.quest.is-mine::before {
  background: var(--pc);
}

.quest.is-both::before {
  background: linear-gradient(var(--simon) 50%, var(--blanka) 50%);
}

.quest.is-new {
  --bc: var(--coin);
  animation: card-in 0.36s steps(5) both, new-glow 0.6s steps(2) 6;
}

.quest.is-preview {
  animation: none;
}

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

.quest__num {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--dim);
}

.quest__new {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--coin);
}

.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--coin);
  text-shadow: 2px 2px 0 var(--line);
}

.quest__title {
  margin: 10px 0 12px;
  font-size: 25px;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.quest__bottom {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quest__bottom .icon-btn--first {
  margin-left: auto;
}

.quest.is-editing {
  --bc: var(--pc);
  animation: none;
}

.quest-editor {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.quest-editor .points-picker {
  margin-top: 4px;
}

.quest-editor .chips--wrap {
  margin-top: 0;
}

.quest-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.marks {
  display: flex;
  gap: 8px;
}

.mark {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 26px;
  padding: 0 4px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--dim);
  font-family: var(--font-pixel);
  font-size: 8px;
  box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line);
}

.mark.is-done {
  background: var(--pc);
  color: #fff;
  animation: pop 0.3s steps(3);
}

.stamp {
  position: absolute;
  top: 6px;
  left: 50%;
  translate: -50% 0;
  padding: 5px 7px;
  border: 3px solid var(--pc);
  color: var(--pc);
  font-family: var(--font-pixel);
  font-size: 9px;
  opacity: 0.85;
  rotate: -6deg;
  pointer-events: none;
  animation: stamp-in 0.35s steps(4) both;
}

.confirm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.confirm__label {
  margin-right: auto;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--coin);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px 18px;
  background: var(--panel);
  text-align: center;
  color: var(--muted);
}

/* ===== Scoreboard ===== */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat {
  --bc: var(--pc);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: color-mix(in srgb, var(--pc) 12%, var(--panel));
  text-align: center;
}

.stat__name {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--pc-light);
}

.stat__pts {
  font-family: var(--font-pixel);
  font-size: 24px;
  color: var(--pc);
  text-shadow: 3px 3px 0 var(--line);
}

.stat__pts small {
  margin-left: 4px;
  font-size: 8px;
  color: var(--muted);
}

.stat__rank {
  min-height: 2.2em;
  font-size: 19px;
  color: var(--coin);
}

.stat__meta {
  font-size: 17px;
  color: var(--muted);
}

.xp {
  width: 100%;
  height: 10px;
  background: var(--line);
  box-shadow: 0 0 0 2px var(--line);
}

.xp span {
  display: block;
  width: calc(var(--p) * 100%);
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--coin) 0 6px, var(--coin-dark) 6px 8px);
  transition: width 0.6s steps(8);
}

.lead-line {
  margin: 20px 0 0;
  font-family: var(--font-pixel);
  font-size: 11px;
  text-align: center;
  color: var(--pc);
  animation: blink 1.6s steps(2) infinite;
}

.matrix {
  background: var(--panel);
  font-size: 19px;
}

.matrix__row {
  display: grid;
  grid-template-columns: 1fr 40px 40px;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-bottom: 2px solid var(--bg-2);
}

.matrix__row:last-child {
  border-bottom: 0;
}

.matrix__row--head {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--muted);
}

.matrix__row--head span:not(:first-child) {
  text-align: center;
  color: var(--pc);
}

.matrix__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell {
  display: grid;
  place-items: center;
  height: 24px;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-pixel);
  font-size: 10px;
}

.cell.is-done {
  background: var(--pc);
  color: #fff;
}

.log {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log__item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-left: 6px solid var(--pc);
  background: var(--panel);
  font-size: 19px;
}

.log__time {
  color: var(--dim);
}

.log__who {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--pc);
}

.log__what {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log__pts {
  color: var(--coin);
}

.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-2);
  text-align: center;
  opacity: 0.55;
}

.badge.is-unlocked {
  --bc: var(--coin);
  background: #261d07;
  opacity: 1;
}

.badge strong {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--coin);
}

.badge small {
  font-size: 16px;
  color: var(--muted);
}

.badge__dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  background: var(--panel-3);
}

.dot.is-on {
  background: var(--pc);
  box-shadow: 0 0 6px var(--pc);
}

.options {
  display: grid;
  gap: 10px;
}

/* ===== Forge ===== */
.points-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.points-picker__value {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  background: var(--bg-2);
}

.points-picker__value input {
  width: 4.2ch;
  border: 0;
  background: transparent;
  color: var(--coin);
  font-family: var(--font-pixel);
  font-size: 20px;
  text-align: center;
  -moz-appearance: textfield;
}

.points-picker__value input::-webkit-inner-spin-button,
.points-picker__value input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.points-picker__value input:focus {
  outline: none;
}

/* ===== Fighter select ===== */
.select__title {
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 1.5;
  text-align: center;
  color: var(--coin);
  text-shadow: 3px 3px 0 var(--blanka-dark), -3px -3px 0 var(--simon-dark);
}

.select__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 440px;
}

.select__card {
  --bc: var(--pc);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 8px 14px;
  border: 0;
  background: color-mix(in srgb, var(--pc) 18%, var(--panel));
  transition: transform 0.15s steps(3), opacity 0.2s steps(2);
}

.select__card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.select__card.is-flipped {
  justify-content: center;
  animation: card-flip 0.35s steps(5) both;
}

.select__card:active {
  transform: scale(0.96);
}

.select__card.is-picked {
  animation: picked 0.7s steps(2) infinite;
}

.select__card.is-dimmed {
  opacity: 0.3;
  filter: grayscale(1);
}

.select__tag {
  align-self: flex-start;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--pc-light);
}

.select__name {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--pc);
  text-shadow: 2px 2px 0 var(--line);
}

.select__current {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--coin);
}

.select__hint {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink);
}

/* ===== Quest roulette ===== */
.roll__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--coin);
}

.roll__slot {
  --bc: var(--coin);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: calc(100% - 8px);
  max-width: 440px;
  min-height: 170px;
  padding: 18px;
  background: var(--panel);
}

.roll__slot.is-settled {
  --bc: var(--pc);
  animation: pop 0.35s steps(3), new-glow 0.5s steps(2) 3;
}

.roll__quest {
  font-size: 28px;
  line-height: 1.05;
}

.roll__actions {
  display: flex;
  gap: 10px;
}

.roll__empty {
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}

/* ===== Login ===== */
.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(40px + var(--safe-t)) var(--gutter) calc(30px + var(--safe-b));
  text-align: center;
}

.login__logo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-pixel);
  animation: logo-drop 0.8s steps(8) both;
}

.logo-line {
  display: block;
  font-size: 40px;
  letter-spacing: 2px;
}

.logo-line--1 {
  color: var(--blanka);
  text-shadow: 4px 4px 0 var(--blanka-dark), 8px 8px 0 var(--line);
}

.logo-line--2 {
  color: var(--simon);
  text-shadow: 4px 4px 0 var(--simon-dark), 8px 8px 0 var(--line);
}

.login__tagline {
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1.8;
  color: var(--coin);
}

.login__stage {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin: 6px 0;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: calc(100% - 8px);
  padding: 18px 14px;
  background: var(--panel);
  text-align: left;
}

.login__form .input {
  text-align: center;
  letter-spacing: 4px;
}

.login__msg {
  min-height: 22px;
  font-size: 20px;
  text-align: center;
  color: var(--bad);
}

.login.is-success .login__msg {
  color: var(--good);
}

.login__coin {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--muted);
}

.login__ready {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.login__ready span {
  font-family: var(--font-pixel);
  font-size: 48px;
  color: var(--coin);
  text-shadow: 5px 5px 0 var(--blanka), -5px -5px 0 var(--simon), 0 0 30px rgba(255, 210, 63, 0.8);
  animation: fight-zoom 1.2s steps(10) both 0.2s;
}

