.btn {
  --btn-a: #ff7ae6;
  --btn-b: #d93fcb;
  --btn-edge: #8a1a84;
  --btn-ink: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b));
  color: var(--btn-ink);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
  box-shadow: 0 5px 0 var(--btn-edge), 0 10px 18px rgba(20, 6, 50, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 4px;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--btn-edge), 0 4px 8px rgba(20, 6, 50, 0.3);
}

.btn:disabled {
  opacity: 0.45;
  filter: saturate(0.5);
}

.btn .icon {
  font-size: 1.15em;
}

.btn-primary {
  --btn-a: #ff7ae6;
  --btn-b: #d93fcb;
  --btn-edge: #8a1a84;
}

.btn-sky {
  --btn-a: #78d4ff;
  --btn-b: #2f9be8;
  --btn-edge: #17609f;
}

.btn-gold {
  --btn-a: #ffe680;
  --btn-b: #ffaf2b;
  --btn-edge: #b36b00;
  --btn-ink: #55270a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-danger {
  --btn-a: #ff8a8a;
  --btn-b: #e0344f;
  --btn-edge: #8c1030;
}

.btn-ghost {
  --btn-a: rgba(255, 255, 255, 0.2);
  --btn-b: rgba(255, 255, 255, 0.08);
  --btn-edge: rgba(20, 6, 50, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-lg {
  min-height: 56px;
  padding: 0 26px;
  font-size: 20px;
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 15px;
  box-shadow: 0 4px 0 var(--btn-edge), 0 8px 14px rgba(20, 6, 50, 0.3);
}

.btn.is-static {
  pointer-events: none;
}

.panel {
  position: relative;
  border-radius: 24px;
  background: var(--panel-bg);
  border: 2px solid var(--panel-line);
  box-shadow: var(--shadow-soft), inset 0 2px 0 rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.chip .icon {
  color: var(--gold);
}

.chip-soft {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
}

.chip-fire {
  background: linear-gradient(180deg, #ff9a3c, #e8501f);
  border-color: #ffd0a0;
}

.chip-fire .icon {
  color: #fff;
}

.star-row {
  display: inline-flex;
  gap: 2px;
}

.star-mark {
  display: inline-flex;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.2);
}

.star-mark svg path {
  fill: rgba(20, 6, 50, 0.45);
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.6;
}

.star-mark.is-on {
  filter: drop-shadow(0 0 6px rgba(255, 210, 63, 0.75));
}

.star-mark.is-on svg path {
  fill: var(--gold);
  stroke: #b97200;
}

.star-row-mini .star-mark {
  font-size: 14px;
}

.section-heading {
  margin: 28px 2px 12px;
}

.section-heading h2 {
  font-size: 27px;
  color: #fff;
  text-shadow: 0 3px 0 rgba(138, 47, 181, 0.9), 0 6px 12px rgba(20, 6, 50, 0.35);
}

.section-kicker {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.ring {
  position: relative;
  flex: none;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 11;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.16);
}

.ring-value {
  stroke: url(#ringGradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: rgba(22, 8, 50, 0.68);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  animation: fadeIn 0.25s ease both;
}

.modal-backdrop.modal-sheet-layer {
  align-items: flex-end;
  padding-bottom: 0;
}

.modal-backdrop.is-leaving {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 18px 18px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 40%), linear-gradient(180deg, #6431b3, #3a1c67);
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 0 #1f0b40, 0 26px 50px rgba(10, 2, 30, 0.6);
  animation: popIn 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  scrollbar-width: none;
}

.modal-card::-webkit-scrollbar {
  display: none;
}

.modal-sheet {
  width: min(100%, 520px);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: calc(18px + var(--safe-bottom));
  animation: sheetIn 0.45s cubic-bezier(0.2, 1, 0.3, 1) both;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 18px;
}

.modal-kicker {
  display: block;
  margin: 0 36px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.modal-title {
  margin: 0 36px 12px;
  text-align: center;
  font-size: 28px;
  color: #fff;
  text-shadow: 0 3px 0 rgba(138, 47, 181, 0.9);
}

.modal-text {
  text-align: center;
  font-size: 16px;
  color: var(--cream);
}

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

.modal-actions .btn {
  flex: 1 1 130px;
}

.modal-actions .btn-lg {
  flex-basis: 100%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
}

@keyframes sheetIn {
  from {
    transform: translateY(100%);
  }
}

.toast {
  max-width: min(100%, 420px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 6px 0 rgba(20, 6, 50, 0.4), 0 12px 24px rgba(20, 6, 50, 0.4);
  animation: toastIn 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.toast-gold {
  background: linear-gradient(180deg, #ffe680, #ffb02e);
  color: #55270a;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
}

.switch {
  position: relative;
  flex: none;
  width: 56px;
  height: 34px;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(20, 6, 50, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: background 0.25s ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 rgba(20, 6, 50, 0.4);
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.switch input:checked + .switch-track {
  background: linear-gradient(180deg, #ff7ae6, #d93fcb);
  border-color: #ffd0f6;
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(22px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.seg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  margin: 14px 0 6px;
  border-radius: 24px;
  background: rgba(20, 6, 50, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.seg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 2px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--lavender);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.seg-btn .icon {
  font-size: 20px;
}

.seg-btn.is-active {
  background: radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 45%), linear-gradient(180deg, #ff7ae6, #d23cc6);
  color: #fff;
  box-shadow: 0 3px 0 #8a1a84, 0 0 16px rgba(255, 90, 220, 0.45);
}
