.btn, .text-btn, .lamp-btn, .quiz-option, .node {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(#8cf58a, var(--green) 46%, var(--green-deep));
  color: #10210f;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.55), 0 4px 0 #0c4a16;
  padding: 12px 14px;
  min-width: 0;
}

.btn:active, .lamp-btn:active, .quiz-option:active, .node:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), 0 1px 0 #0c4a16; }

.btn.gold { background: linear-gradient(#ffe58a, var(--gold) 46%, #c48410); box-shadow: inset 0 2px 0 rgba(255,255,255,0.6), 0 4px 0 #6d4a08; color: #2a1c08; }
.btn.ghost, .text-btn { background: #2a221b; color: var(--cream); box-shadow: inset 0 2px 0 rgba(255,255,255,0.12), 0 4px 0 #070604; }
.btn.danger { background: linear-gradient(#ff8d84, var(--red) 50%, #8d1c16); color: #2a0806; box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 4px 0 #5c100c; }

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

.chip, .meter {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.28);
  color: var(--cream);
  font-size: 0.78rem;
}

.star-row { display: inline-flex; gap: 2px; color: #6d6458; }
.star-row .is-on { color: var(--gold); }
.star-row .is-on svg { fill: currentColor; }

.ring { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.ring svg { width: 72px; height: 72px; flex: 0 0 auto; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 8; }
.ring-value { fill: none; stroke: var(--green); stroke-width: 8; stroke-linecap: round; }
.ring-copy { display: flex; flex-direction: column; flex: 0 0 auto; }
.ring-copy strong { font-family: var(--display); font-size: 1.6rem; }
.ring-copy small { color: var(--muted); }

.section-title { display: grid; gap: 6px; margin-bottom: 12px; }
.section-title p:last-child { color: var(--muted); }

.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 4, 3, 0.62);
}

.modal-card {
  width: min(440px, 100%);
  max-height: min(86dvh, 640px);
  overflow: auto;
  background: linear-gradient(180deg, #3a2e22, #1a1511);
  border: 3px solid rgba(246, 201, 69, 0.55);
  border-radius: 24px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 12px 0 #070604;
}

.modal-title { margin: 4px 0 8px; }
.modal-copy { color: var(--cream); }
.modal-body { display: grid; gap: 8px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.modal-actions .btn { flex: 1 1 120px; }

.modal.is-win .modal-card { border-color: var(--gold); }
.modal.is-fail .modal-card { border-color: var(--red); }
.modal.is-coach {
  place-items: start center;
  background: transparent;
  pointer-events: none;
  padding-top: calc(8px + var(--safe-top));
}
.modal.is-coach .modal-card { pointer-events: auto; max-height: 46dvh; }

.toast {
  background: #2a221b;
  border: 2px solid var(--amber);
  color: var(--cream);
  border-radius: 14px;
  padding: 8px 12px;
  max-width: min(420px, 100%);
  box-shadow: 0 6px 0 #070604;
}

.toast.is-danger { border-color: var(--red); }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.switch input { position: absolute; opacity: 0; }

.switch i {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #3a332c;
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.4);
  position: relative;
  flex: 0 0 auto;
}

.switch i::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  left: 4px;
  top: 4px;
  background: #cbb89a;
}

.switch input:checked + i { background: var(--green-deep); }
.switch input:checked + i::after { transform: translateX(22px); background: #d8ffb0; }

.seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.seg-item {
  min-width: 0;
  text-align: center;
  padding: 8px 6px;
  border-radius: 999px;
  background: #241c16;
  border: 2px solid transparent;
  color: var(--muted);
}

@media (min-width: 560px) {
  .seg { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.seg-item.is-active { color: #2a1c08; background: linear-gradient(#ffe58a, var(--gold)); border-color: #fff1b8; }

.meter-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  overflow: hidden;
}

.meter-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent, var(--green)), var(--gold));
  border-radius: inherit;
}
