.btn, .tool-btn, .pad-btn, .quiz-option, .node, .teaser, .ride-card {
  border: 0;
  position: relative;
}

.btn {
  min-width: 0;
  border-radius: 16px;
  padding: 0.8rem 1rem;
  color: #2a120c;
  background: linear-gradient(180deg, #ffd29a 0%, #ff7a3c 42%, #ff3b24 100%);
  box-shadow: 0 5px 0 var(--primary-dark), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  font-family: var(--display);
}

.btn::before, .pad-btn::before, .tool-btn::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 3px;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent);
  pointer-events: none;
}

.btn:active, .pad-btn:active, .tool-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--primary-dark); }

.btn-gold {
  color: #3a2504;
  background: linear-gradient(180deg, #fff1b8, #ffc531 46%, #e09a12);
  box-shadow: 0 5px 0 #8a5a08, inset 0 2px 0 rgba(255, 255, 255, 0.65);
}

.btn-ghost, .btn-danger {
  color: var(--text);
  background: linear-gradient(180deg, #3a4152, #222733);
  box-shadow: 0 5px 0 #0c0e13, inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-danger { color: #ffd7d8; }

.btn:disabled {
  filter: grayscale(0.4);
  opacity: 0.7;
}

.panel {
  min-width: 0;
  background: linear-gradient(180deg, rgba(38, 44, 58, 0.94), rgba(18, 22, 30, 0.94));
  border: 2px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 14px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #1a1e28;
  display: grid;
  place-items: center;
}

.stars { display: inline-flex; gap: 2px; color: var(--secondary); }
.stars .off { opacity: 0.35; }

.ring-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ring { width: 72px; height: 72px; flex: 0 0 auto; transform: rotate(-90deg); }
.ring-track, .ring-value { fill: none; stroke-width: 7; }
.ring-track { stroke: rgba(255, 255, 255, 0.12); }
.ring-value { stroke: var(--secondary); stroke-linecap: round; }
.ring-copy { min-width: 0; }
.ring-copy strong { display: block; font-family: var(--display); font-size: 1.3rem; }
.ring-copy span { color: var(--muted); }

.modal-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  pointer-events: auto;
  padding: 12px;
  padding-bottom: calc(12px + var(--safe-bottom));
}

.modal-shade {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 7, 10, 0.62);
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  max-height: min(86dvh, 720px);
  overflow: auto;
  padding: 16px;
  border-radius: 26px 26px 18px 18px;
  background: linear-gradient(180deg, #323846, #171b24);
  border: 2px solid var(--secondary);
  box-shadow: 0 12px 0 #07080c;
}

.modal-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.modal-head h2 { min-width: 0; }
.modal-body { margin-top: 10px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1 1 120px; }

.toast {
  pointer-events: none;
  max-width: min(420px, 100%);
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: #24180f;
  border: 1px solid var(--accent);
  box-shadow: 0 6px 0 #07080c;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s ease;
}

.toast.show { opacity: 1; transform: none; }
.toast.good { border-color: var(--success); }

.switch {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #12151c;
  padding: 2px;
}

.switch i {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--metal);
  transition: transform 0.2s ease;
}

.switch.on { background: #6a3a10; }
.switch.on i { transform: translateX(20px); background: var(--secondary); }

.tabs, .segmented {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.tabs button, .segmented button {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #171b24;
  padding: 0.55rem 0.4rem;
  color: var(--muted);
}

.tabs button.on, .segmented button.on {
  color: #2a120c;
  border-color: #fff1c2;
  background: linear-gradient(180deg, #ffe7a3, #ffc531);
}

.preview-canvas {
  width: 100%;
  max-width: 100%;
  height: auto !important;
  border-radius: 16px;
  background: #10141c;
}
