html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0f1720;
  color: #eef2f4;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- 启动加载、轻提示、确认框 ---------- */

#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(70% 55% at 50% 30%, rgba(232, 98, 42, 0.22), rgba(232, 98, 42, 0) 70%),
    #0b1117;
  color: #eef2f4;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

#boot.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #ffe6a8;
  text-shadow: 0 8px 28px rgba(232, 98, 42, 0.45);
}

.boot-ring {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: #8ff0d4;
  border-radius: 50%;
  animation: bootSpin 0.9s linear infinite;
}

#boot-status {
  margin: 0;
  font-size: 13px;
  color: #8d979d;
}

#boot.error .boot-ring {
  display: none;
}

#boot.error #boot-status {
  max-width: min(560px, 88vw);
  text-align: center;
  color: #ff9a8a;
  line-height: 1.6;
}

#boot-retry {
  padding: 10px 22px;
  font-size: 14px;
}

#boot-retry[hidden] {
  display: none;
}

@keyframes bootSpin {
  to { transform: rotate(360deg); }
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  max-width: min(520px, 88vw);
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(16, 23, 30, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: #eef2f4;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

#toast.success {
  border-color: rgba(143, 240, 212, 0.42);
  color: #bff6e4;
}

#toast.error {
  border-color: rgba(255, 122, 100, 0.48);
  color: #ffb3a8;
}

#confirm {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(4px);
}

#confirm.on {
  display: flex;
  animation: overlayIn 0.16s ease-out;
}

.confirm-box {
  width: min(390px, 92vw);
  padding: 24px 24px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: #141a20;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

#confirm.on .confirm-box {
  animation: panelIn 0.2s ease-out;
}

#confirm-title {
  margin: 0 0 8px;
  font-size: 19px;
  color: #ffe6a8;
}

#confirm-body {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.65;
  color: #9fb0b8;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions button {
  flex: 1;
  padding: 11px 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

#confirm-ok {
  border: none;
  background: #e8622a;
  color: #fff;
  font-weight: 700;
}

#confirm-ok.danger {
  background: #c94a3f;
  box-shadow: 0 8px 22px rgba(201, 74, 63, 0.28);
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- 通用交互反馈 ---------- */

button:not(:disabled) {
  transition:
    transform 0.12s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:not(:disabled):active {
  transform: translateY(0) scale(0.985);
}

:focus-visible {
  outline: 2px solid #8ff0d4;
  outline-offset: 3px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

body.menu-mode #keys,
body.paused-mode #keys {
  display: none;
}

body.app-ready #menu.on .menu-inner {
  animation: panelIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#lessons.on,
#over.on,
#paused.on,
#skin.on {
  animation: overlayIn 0.18s ease-out;
}

#lessons.on .lessons-box,
#over.on .over-box,
#paused.on .paused-box,
#skin.on .skin-box {
  animation: panelIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- 游戏中的 HUD ---------- */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#hud.hide {
  display: none;
}

#score {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffe6a8;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.7);
}

#grip {
  position: absolute;
  top: 22px;
  left: 26px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #0f1720;
  background: #8ff0d4;
  border-radius: 999px;
  padding: 6px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

#grip.bh {
  background: #ffd166;
}

#grip.pop {
  animation: gripPop 0.4s ease;
}

@keyframes gripPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 高度标尺：把球现在的高度对应到"该打什么球" */
#gauge {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 96px;
  height: 210px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 16, 22, 0.55);
  display: none;
}

#gauge.on {
  display: block;
}

.g-band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.g-band[data-band="high"] {
  height: 33%;
  background: rgba(143, 240, 212, 0.1);
}

.g-band[data-band="mid"] {
  height: 25%;
  background: rgba(255, 209, 102, 0.1);
}

.g-band[data-band="low"] {
  height: 42%;
  background: rgba(255, 138, 61, 0.1);
}

.g-band em {
  position: absolute;
  left: 7px;
  font-style: normal;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.g-name {
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
  color: #dbe4e9;
}

#gauge-marker {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

/* 教学关卡的提示面板 */
#tut {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  width: min(660px, 92vw);
  background: rgba(10, 16, 22, 0.7);
  border: 1px solid rgba(143, 240, 212, 0.28);
  border-radius: 16px;
  padding: 14px 20px;
  display: none;
  pointer-events: none;
}

#tut.on {
  display: block;
}

.tut-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

#tut-step {
  font-size: 13px;
  color: #8ff0d4;
  letter-spacing: 1px;
}

#tut-title {
  font-size: 19px;
  color: #ffe6a8;
}

#tut-body {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.65;
  color: #d7dee2;
}

#tut-keys {
  margin: 0;
  font-size: 13px;
  color: #ffd166;
}

.tut-fb {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 700;
  min-height: 22px;
}

.tut-fb.good {
  color: #8ff0d4;
}

.tut-fb.bad {
  color: #ff9a7a;
}

/* 菜单里的灵敏度和两个按钮 */
.sens-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #9fb0b8;
}

.sens-row input[type="range"] {
  flex: 1;
  accent-color: #e8622a;
}

.sens-row b {
  min-width: 52px;
  text-align: right;
  color: #ffd166;
  font-size: 15px;
}

.vol-row {
  display: flex;
  gap: 20px;
  margin: -2px 0 12px;
  font-size: 13px;
  color: #9fb0b8;
}

.vol-row label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.vol-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: #8ff0d4;
}

.vol-row b {
  flex: 0 0 36px;
  text-align: right;
  color: #8ff0d4;
  font-size: 13px;
  font-weight: 600;
}

.diff-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -2px 0 10px;
  font-size: 13px;
  color: #9fb0b8;
}

.diff-row > span {
  flex: 0 0 70px;
}

.diff-btns {
  flex: 1;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.diff-hint {
  margin: -4px 0 10px 82px;
  text-align: left;
  font-size: 12px;
  color: #66707a;
}

.start-row {
  display: flex;
  gap: 12px;
}

.start-row button {
  flex: 1;
}

button.ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #eef2f4;
  border-radius: 999px;
  padding: 18px 0;
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
}

button.ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* 教学关卡的课程列表 */
#lessons {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
  background: rgba(8, 12, 16, 0.86);
}

#lessons.on {
  display: flex;
}

.lessons-box {
  width: min(620px, 94vw);
  background: #141a20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 26px 26px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.lessons-box h2 {
  margin: 0 0 8px;
  font-size: 26px;
  color: #ffe6a8;
  letter-spacing: 2px;
}

.lessons-sub {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.7;
  color: #8d979d;
}

#lesson-list {
  max-height: 46vh;
  overflow-y: auto;
  margin-bottom: 18px;
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}

.lesson-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.lesson-row.done {
  background: rgba(143, 240, 212, 0.08);
}

.lesson-row .ln {
  flex: 0 0 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #cfd8de;
}

.lesson-row.done .ln {
  background: #8ff0d4;
  color: #0f1720;
}

.lesson-row .lm {
  flex: 1;
}

.lesson-row .lm b {
  display: block;
  font-size: 16px;
  color: #eef2f4;
  font-weight: 600;
}

.lesson-row .lm em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: #8d979d;
  margin-top: 2px;
}

.lessons-foot {
  display: flex;
  gap: 12px;
}

.lessons-foot button {
  flex: 1;
  padding: 14px 0;
  font-size: 16px;
}

.lessons-tip {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #66707a;
}

#msg {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 19px;
  color: #ffffff;
  background: rgba(10, 16, 22, 0.55);
  border-radius: 999px;
  padding: 8px 22px;
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
}

#fps {
  position: absolute;
  right: 24px;
  bottom: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(10, 16, 22, 0.5);
  border-radius: 999px;
  padding: 5px 14px;
}

#crosshair span {
  position: absolute;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

#crosshair span:first-child {
  left: 9px;
  top: 0;
  width: 2px;
  height: 20px;
}

#crosshair span:last-child {
  top: 9px;
  left: 0;
  height: 2px;
  width: 20px;
}

#meter {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  width: 300px;
  text-align: center;
}

#power {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.15s;
}

#power.on {
  opacity: 1;
}

#power-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8ff0d4, #ffd166 65%, #ff5f5f);
  transition: width 0.05s linear;
}

#shot {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #ffe6a8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  height: 24px;
}

#keys {
  position: fixed;
  left: 18px;
  bottom: 18px;
  max-width: 300px;
  background: rgba(10, 16, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #cfd8de;
  display: none;
}

#keys.on {
  display: block;
}

#keys h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #8ff0d4;
}

#keys p {
  margin: 0 0 6px;
}

#keys table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
}

#keys td {
  padding: 2px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

#keys td:last-child {
  text-align: right;
  color: #ffe6a8;
}

#keys .tip {
  color: #7d8891;
  margin: 4px 0 0;
}

#paused {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 14, 0.6);
  cursor: pointer;
}

#paused.on {
  display: flex;
}

.paused-box {
  width: min(360px, 88vw);
  background: #141a20;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 26px 26px 18px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.paused-title {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 700;
  color: #ffe6a8;
  letter-spacing: 2px;
}

.paused-box button {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 15px 0;
  font-size: 17px;
}

#pause-resume {
  background: #e8622a;
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

#pause-resume:hover {
  background: #ff7a3d;
}

.paused-tip {
  margin: 8px 0 0;
  font-size: 12px;
  color: #66707a;
}

.pause-vol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 2px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pause-vol label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #9fb0b8;
}

.pause-vol input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: #8ff0d4;
}

.pause-vol b {
  flex: 0 0 36px;
  text-align: right;
  color: #8ff0d4;
  font-size: 12px;
}

.diff-btns button {
  flex: 1;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 7px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #cfd8de;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.diff-btns button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.diff-btns button.on {
  background: #8ff0d4;
  border-color: #8ff0d4;
  color: #0f1720;
  font-weight: 700;
}

.pause-diff {
  margin: 2px 0 10px;
}

.pause-diff > span {
  flex: 0 0 64px;
}

/* 比赛结算面板 */
#over {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 16, 0.82);
}

#over.on {
  display: flex;
}

.over-box {
  width: min(380px, 90vw);
  background: #141a20;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 30px 30px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.over-label {
  margin: 0;
  font-size: 13px;
  letter-spacing: 3px;
  color: #8d979d;
}

.over-score {
  margin: 6px 0 2px;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #ffe6a8;
}

.over-title {
  margin: 0 0 22px;
  font-size: 20px;
  color: #8ff0d4;
}

.over-box button {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 15px 0;
  font-size: 17px;
}

#over-again {
  background: #e8622a;
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

#over-again:hover {
  background: #ff7a3d;
}

/* ---------- 开始界面 ---------- */

#menu {
  position: fixed;
  inset: 0;
  display: none;
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(232, 98, 42, 0.3), rgba(232, 98, 42, 0) 62%),
    radial-gradient(70% 60% at 50% 110%, rgba(143, 240, 212, 0.16), rgba(143, 240, 212, 0) 60%),
    rgba(8, 12, 16, 0.86);
}

#menu.on {
  display: flex;
}

.menu-inner {
  width: min(640px, 94vw);
  text-align: center;
  padding: 8px 0 26px;
}

.art {
  width: min(340px, 78vw);
  margin: 0 auto 6px;
}

#menu h1 {
  margin: 0;
  font-size: 54px;
  letter-spacing: 6px;
  color: #ffe6a8;
  text-shadow: 0 8px 30px rgba(232, 98, 42, 0.6);
}

.sub {
  margin: 10px 0 22px;
  color: #aab4ba;
  font-size: 16px;
}

.menu-cols {
  display: flex;
  gap: 18px;
  text-align: left;
  margin-bottom: 20px;
}

.menu-cols > div {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 14px 18px;
}

.menu-cols h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #8ff0d4;
  letter-spacing: 1px;
}

.menu-cols ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.9;
  color: #d7dee2;
}

.menu-cols b {
  color: #ffd166;
}

#menu-start {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 18px 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  background: linear-gradient(180deg, #ff7a3d, #e8622a);
  box-shadow: 0 10px 30px rgba(232, 98, 42, 0.45);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, box-shadow 0.2s;
}

#menu-start:hover {
  box-shadow: 0 12px 36px rgba(232, 98, 42, 0.6);
}

#menu-start:active {
  transform: scale(0.98);
}

.foot {
  margin: 14px 0 0;
  font-size: 13px;
  color: #7d8891;
}

.foot.dim {
  color: #55606a;
}

/* ---------- 球拍皮肤 ---------- */

.skin-link {
  width: 100%;
  margin-top: 12px;
  padding: 12px 0;
  border: 1px dashed rgba(143, 240, 212, 0.4);
  border-radius: 14px;
  background: rgba(143, 240, 212, 0.06);
  color: #bff6e4;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.skin-link:hover {
  background: rgba(143, 240, 212, 0.14);
  border-color: #8ff0d4;
}

#skin {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 10, 14, 0.82);
  backdrop-filter: blur(5px);
}

#skin.on {
  display: flex;
}

.skin-box {
  width: min(880px, 96vw);
  max-height: 94vh;
  overflow-y: auto;
  padding: 22px 26px 18px;
  background: #131a21;
  border: 1px solid rgba(143, 240, 212, 0.22);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.skin-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.skin-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 2px;
  color: #ffe6a8;
}

.skin-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #8d979d;
}

.skin-library {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.skin-library-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.skin-library-head > span {
  flex: 0 0 70px;
  font-size: 13px;
  color: #9fb0b8;
}

#skin-name {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: #eef2f4;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

#skin-name:focus {
  border-color: #8ff0d4;
}

.skin-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.skin-empty {
  align-self: center;
  flex: 0 0 auto;
  padding: 0 4px;
  color: #66707a;
  font-size: 12px;
}

.skin-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #cfd8de;
  font-family: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.skin-chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

.skin-chip.on {
  background: #8ff0d4;
  border-color: #8ff0d4;
  color: #0f1720;
  font-weight: 700;
}

.skin-chip i {
  display: block;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
}

.skin-library-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skin-library-actions button {
  flex: 0 0 auto;
}

.skin-library-actions button:disabled {
  opacity: 0.35;
  cursor: default;
}

.skin-x {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #cfd8de;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.skin-x:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.skin-body {
  display: flex;
  gap: 22px;
  align-items: stretch;
}

.skin-preview {
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background:
    radial-gradient(70% 55% at 50% 34%, rgba(143, 240, 212, 0.12), rgba(143, 240, 212, 0) 70%),
    #0d1318;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
}

.skin-preview canvas {
  width: 100%;
  max-width: 230px;
  height: auto;
  display: block;
}

.skin-preview p {
  margin: 2px 0 4px;
  font-size: 12px;
  letter-spacing: 2px;
  color: #66707a;
}

.skin-right {
  flex: 1;
  min-width: 0;
}

.skin-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.skin-colors label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 13px;
  color: #cfd8de;
}

.skin-colors input[type="color"],
.skin-tools input[type="color"] {
  width: 30px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.skin-colors input[type="color"]::-webkit-color-swatch-wrapper,
.skin-tools input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.skin-colors input[type="color"]::-webkit-color-swatch,
.skin-tools input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.skin-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #cfd8de;
}

.skin-tools label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skin-size-label input[type="range"] {
  width: 104px;
  accent-color: #e8622a;
}

button.skin-mini {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 9px;
}

#skin-erase.on {
  background: rgba(232, 98, 42, 0.3);
  border-color: #ff7a3d;
  color: #ffe6a8;
}

.skin-draw {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 10px;
  border-radius: 16px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 12px, rgba(255, 255, 255, 0) 12px 24px),
    #0d1318;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.net-wrap,
.shaft-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.net-wrap span,
.shaft-wrap span {
  font-size: 12px;
  color: #66707a;
  letter-spacing: 1px;
}

#skin-net-canvas {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 2px solid rgba(238, 243, 247, 0.42);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.65), 0 0 22px rgba(143, 240, 212, 0.08);
  cursor: crosshair;
  touch-action: none;
}

#skin-shaft-canvas {
  width: 66px;
  height: 220px;
  border-radius: 12px;
  border: 2px solid rgba(238, 243, 247, 0.42);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.65);
  cursor: crosshair;
  touch-action: none;
}

.skin-clears {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.skin-foot {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.skin-foot .ghost {
  flex: 0 0 180px;
  padding: 14px 0;
  font-size: 16px;
}

#skin-apply {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(180deg, #ff7a3d, #e8622a);
  box-shadow: 0 8px 24px rgba(232, 98, 42, 0.35);
  cursor: pointer;
  font-family: inherit;
}

#skin-apply:hover {
  box-shadow: 0 10px 30px rgba(232, 98, 42, 0.5);
}

.skin-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: #66707a;
}

.skin-note.good {
  color: #8ff0d4;
}

#hud.inspecting #crosshair,
#hud.inspecting #gauge,
#hud.inspecting #meter,
#hud.inspecting #grip,
#hud.inspecting #score,
#hud.inspecting #msg,
#hud.inspecting #fps {
  opacity: 0;
  transition: opacity 0.2s;
}

body.inspecting #keys {
  opacity: 0;
}

#keys {
  transition: opacity 0.2s;
}

@media (max-width: 620px) {
  #menu h1 { font-size: 38px; letter-spacing: 4px; }
  .menu-cols { flex-direction: column; gap: 10px; }
}

@media (max-width: 760px) {
  .skin-body { flex-direction: column; }
  .skin-preview { flex: 0 0 auto; }
  .skin-preview canvas { max-width: 170px; }
  #skin-net-canvas { width: 180px; height: 180px; }
  #skin-shaft-canvas { width: 56px; height: 187px; }
  .skin-foot .ghost { flex: 0 0 120px; }
}

.skin-box,
#lesson-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 240, 212, 0.35) transparent;
}

.skin-box::-webkit-scrollbar,
#lesson-list::-webkit-scrollbar {
  width: 8px;
}

.skin-box::-webkit-scrollbar-thumb,
#lesson-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(143, 240, 212, 0.28);
}

@media (max-width: 760px) {
  .art { width: min(260px, 60vw); }
  #menu h1 { font-size: 40px; letter-spacing: 4px; }
  .sub { margin: 6px 0 14px; font-size: 14px; }
  .menu-cols { margin-bottom: 12px; }
  #menu-start { padding: 14px 0; font-size: 19px; }
  .menu-inner { width: min(560px, 94vw); }
  .start-row { flex-direction: column; }
  .start-row button { width: 100%; }
  .vol-row { flex-direction: column; gap: 8px; }
  .diff-row { flex-wrap: wrap; }
  .diff-row > span { flex: 0 0 100%; }
  .diff-hint { margin-left: 0; }
  #score { font-size: 28px; }
  #grip { top: 14px; left: 14px; font-size: 14px; padding: 5px 12px; }
  #gauge { right: 10px; width: 80px; height: 180px; }
  #meter { bottom: 40px; width: min(280px, calc(100vw - 32px)); }
  #tut { bottom: 88px; width: calc(100vw - 24px); padding: 12px 14px; }
  #keys { left: 10px; bottom: 10px; max-width: calc(100vw - 20px); font-size: 12px; }
  .pause-box { width: min(360px, 92vw); padding: 20px 18px 14px; }
  .skin-box { padding: 16px; }
  .skin-library-head { flex-wrap: wrap; }
  .skin-library-head > span { flex: 0 0 100%; }
  #skin-name { flex: 1 1 100%; }
  .skin-library-actions button { flex: 1 1 auto; }
  .skin-foot { flex-direction: column; }
  .skin-foot .ghost { flex: 0 0 auto; width: 100%; }
  #toast { bottom: 16px; }
}

@media (max-width: 620px) {
  #menu h1 { font-size: 36px; letter-spacing: 3px; }
  .menu-inner { width: 94vw; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .boot-ring {
    animation: none;
    border-top-color: #8ff0d4;
  }
}
