.panel {
  min-width: 0;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 7px 0 rgba(4, 24, 46, 0.55);
  padding: 14px;
  backdrop-filter: blur(8px);
}

.btn, .tool-btn, .quiz-option, .node {
  position: relative;
  border: 3px solid #fff6d0;
  border-radius: 16px;
  background: linear-gradient(#ffe98a, #f0a400 55%, #d98400);
  color: #3a2504;
  box-shadow: 0 5px 0 #8a5600;
  padding: 10px 14px;
  overflow: hidden;
}

.btn::before, .quiz-option::before, .node::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 3px;
  height: 38%;
  border-radius: 10px;
  background: linear-gradient(rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.btn:active, .tool-btn:active, .quiz-option:active, .node:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #8a5600;
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-width: 0; }
.btn-sky { background: linear-gradient(#8fd8ff, #1286f0 60%, #0a5cb8); color: white; box-shadow: 0 5px 0 #08427a; }
.btn-ghost { background: linear-gradient(#1a4e8c, #0c3568); color: var(--text); box-shadow: 0 5px 0 #06213f; }
.btn-danger { background: linear-gradient(#ff8aa0, #ff4b6e 60%, #c41d42); color: white; box-shadow: 0 5px 0 #7a1028; }
.btn:disabled { filter: grayscale(0.4); }

.section-title {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  text-shadow: 0 3px 0 rgba(4, 24, 46, 0.35);
}

.star-row { display: inline-flex; gap: 2px; }
.star-mark { width: 16px; height: 16px; color: rgba(255, 255, 255, 0.35); }
.star-mark.is-on { color: var(--highlight); }

.ring { position: relative; width: 92px; height: 92px; flex: 0 0 auto; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: rgba(255, 255, 255, 0.25); }
.ring-bar { stroke: var(--highlight); stroke-linecap: round; }
.ring-copy {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}
.ring-copy strong { font-family: "Hoist Display", sans-serif; font-size: 1.3rem; }
.ring-copy span { font-size: 0.68rem; }

.modal-scrim {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 18, 36, 0.55);
}

.modal-card {
  width: min(440px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  position: relative;
  background: linear-gradient(#14509a, #0a3268);
  border: 3px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 10px 0 #04182e;
  padding: 18px 16px 16px;
}

.modal-title { font-size: clamp(1.4rem, 5vw, 2rem); margin-top: 4px; }
.modal-kicker { color: var(--highlight); margin: 0; }
.modal-copy { margin-top: 8px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1 1 120px; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #0c3568;
  color: white;
}

.toast {
  pointer-events: none;
  max-width: min(420px, 100%);
  background: #0c3568;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 5px 0 #04182e;
}

.toast-warn { border-color: #ff8aa0; }
.toast.is-out { opacity: 0; transition: opacity 0.3s; }

.switch-row, .slider-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; position: absolute; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #0a2748;
  border: 2px solid var(--line);
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d5e8f8;
  transition: transform 0.2s ease;
}
.switch input:checked + i { background: #1286f0; }
.switch input:checked + i::after { transform: translateX(22px); background: var(--highlight); }

.segment { display: flex; flex-wrap: wrap; gap: 6px; }
.segment a, .segment button {
  flex: 1 1 70px;
  min-width: 0;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(8, 30, 60, 0.45);
  color: var(--text);
  padding: 8px 6px;
}
.segment .is-on { border-color: var(--highlight); background: #0e4e96; color: var(--highlight); }

input[type="range"] { width: min(180px, 46vw); accent-color: var(--secondary); }
.name-field {
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: rgba(4, 24, 46, 0.45);
  padding: 8px 10px;
}

.bob { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob {
  50% { transform: translateY(-6px); }
}
