* { margin: 0; box-sizing: border-box; }
.hidden:not(.overlay) { display: none; } /* overlays keep their opacity fade via .overlay.hidden */
html, body { height: 100%; overflow: hidden; background: #171032; }
canvas { position: fixed; inset: 0; display: block; touch-action: none; }

.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 12, 45, .55);
  backdrop-filter: blur(6px);
  transition: opacity .25s;
  padding: 12px;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.card {
  background: linear-gradient(160deg, #fff7fb, #ffeef7);
  border-radius: 28px;
  padding: 26px 30px;
  width: min(92vw, 430px);
  max-height: 94vh; overflow-y: auto;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5);
  font-family: 'Comic Sans MS', 'Segoe UI', 'Trebuchet MS', sans-serif;
  color: #4a3550;
}
h1 { font-size: 1.65rem; margin-bottom: 6px; }
.tag { color: #8a6a85; margin-bottom: 14px; font-size: .95rem; }

button.big {
  display: block; width: 100%; margin: 10px 0; padding: 13px;
  font: inherit; font-size: 1.08rem; font-weight: bold;
  border: none; border-radius: 18px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #ff7bb0, #ff4f8b);
  box-shadow: 0 5px 0 #d13a72;
  transition: transform .08s, box-shadow .08s;
}
button.big:active { transform: translateY(3px); box-shadow: 0 2px 0 #d13a72; }
button.big.alt { background: linear-gradient(135deg, #7fd8ff, #4fa3ff); box-shadow: 0 5px 0 #2f6fc4; }
button.big.alt:active { box-shadow: 0 2px 0 #2f6fc4; }

button.big.gift { background: linear-gradient(135deg, #b98bff, #8f5bff); box-shadow: 0 5px 0 #6a3fd1; }
button.big.gift:active { box-shadow: 0 2px 0 #6a3fd1; }

.challenge { font-size: .92rem; font-weight: bold; color: #8f5bff; margin: 2px 0 10px; }
.tag.small { font-size: .78rem; color: #b49ab2; }

.optrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.seg { display: flex; border: 1px solid #f0c9dd; border-radius: 12px; overflow: hidden; }
.seg button {
  font: inherit; font-size: .8rem; border: none; background: #fff; color: #8a6a85;
  padding: 7px 9px; cursor: pointer;
}
.seg button.sel { background: linear-gradient(135deg, #ff7bb0, #ff4f8b); color: #fff; font-weight: bold; }
.linkbtn {
  font: inherit; font-size: .78rem; border: none; background: none; color: #8a6a85;
  text-decoration: underline; cursor: pointer; padding: 4px;
}

.mysongs { margin-top: 14px; text-align: left; }
.mysongs-title { font-size: .92rem; font-weight: bold; color: #8a6a85; margin-bottom: 2px; }
.mysongs-title .hint { font-weight: normal; font-size: .74rem; color: #b49ab2; }
.songrow { display: flex; align-items: center; gap: 6px; margin: 7px 0; }
.songrow button {
  font: inherit; border: none; border-radius: 12px; cursor: pointer; padding: 9px 10px;
  color: #4a3550; transition: transform .08s, box-shadow .08s;
}
.songrow button:active { transform: translateY(2px); }
.songrow .playbtn {
  flex: 1; min-width: 0; text-align: left; font-weight: bold; font-size: .93rem;
  background: #fff; border: 1px solid #f0c9dd; box-shadow: 0 3px 0 #eebcd6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.songrow .playbtn:active { box-shadow: 0 1px 0 #eebcd6; }
.songrow .iconbtn {
  font-size: .85rem; background: #f3e9ff; border: 1px solid #ddc9f0; box-shadow: 0 3px 0 #d4bfe8;
  flex-shrink: 0;
}
.songrow .iconbtn:active { box-shadow: 0 1px 0 #d4bfe8; }

.how { margin-top: 14px; }
.how p { margin: 5px 0; font-size: .92rem; text-align: left; }
.how .keys { font-size: .78rem; color: #9a85a5; text-align: center; margin-top: 10px; }
kbd {
  background: #fff; border: 1px solid #d8c8d8; border-bottom-width: 2px;
  border-radius: 4px; padding: 0 5px; font-size: .75rem;
}

.vol { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; font-size: 1.1rem; }
.vol input { width: 60%; accent-color: #ff4f8b; }

.spinner {
  width: 44px; height: 44px; margin: 14px auto;
  border: 5px solid #ffd6e8; border-top-color: #ff4f8b; border-radius: 50%;
  animation: spin 1s linear infinite;
}
.spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.backlink { margin-top: 14px; font-size: .82rem; }
.backlink a { color: #9a85a5; text-decoration: none; }
.backlink a:hover { color: #4a3550; }
