/* Piano Rush · Sube tu canción (player site): the one-time code boxes, the terms checkbox and
   the send result. */
/* 8 boxes (2026-10-10, codes went from 6 to 8 characters): they fit a 320 px phone (about 258 px
   inside the card) down to 28 px a box. */
.code-boxes { position: relative; width: 100%; max-width: 480px; }
.code-boxes input {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0;
  opacity: 0.01; color: transparent; caret-color: transparent; background: transparent; border: 0;
  font-size: 16px; letter-spacing: 0; z-index: 2; cursor: text;
}
.code-boxes input:focus, .code-boxes input:focus-visible { box-shadow: none; outline: none; }
/* Owner 2026-10-10: one ring at a time (the box being typed), no ring around the whole row, and
   the caret drawn over the box (it used to push the last letter up). */
.boxes { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); gap: 8px; }
.box {
  position: relative; height: 60px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 26px; font-weight: 700; line-height: 1; color: #fff;
  background: var(--field); border: 2px solid var(--line2);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.box.filled { border-color: rgba(63, 224, 255, 0.45); background: rgba(63, 224, 255, 0.07); }
.code-boxes.focused .box.active { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 79, 163, 0.28); }
.code-boxes.focused .box.active:not(.filled)::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 2px; height: 26px; margin: -13px 0 0 -1px;
  border-radius: 1px; background: var(--pink); animation: blink 1s steps(1) infinite;
}
.code-boxes.complete .box { border-color: rgba(63, 224, 140, 0.8); background: rgba(63, 224, 140, 0.08); }
.code-boxes.complete.focused .box, .code-boxes.complete.focused .box.active { border-color: rgba(63, 224, 140, 0.9); box-shadow: 0 0 0 2px rgba(63, 224, 140, 0.18); }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .code-boxes.focused .box.active::after { animation: none; } }
@media (max-width: 420px) {
  .boxes { gap: 5px; }
  .box { height: 48px; font-size: 21px; border-radius: 9px; }
  .code-boxes.focused .box.active:not(.filled)::after { height: 22px; margin-top: -11px; }
}
@media (max-width: 360px) {
  .boxes { gap: 4px; }
  .box { height: 44px; font-size: 19px; border-radius: 8px; border-width: 1.5px; }
}

#playerForm { display: flex; flex-direction: column; gap: 16px; }
#playerTargetField { max-width: 440px; }

/* The terms checkbox (required before both buttons): the whole row is the tap target (44 px
   at least), a focus ring on the box, green once ticked like a complete code. */
.terms-field { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.terms-check {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px;
  border-radius: 14px; cursor: pointer; font-weight: 600; line-height: 1.35;
  background: var(--field); border: 2px solid var(--line2);
  transition: border-color 0.15s, background-color 0.15s;
}
.terms-check:hover { border-color: rgba(255, 255, 255, 0.32); }
.terms-check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--green); cursor: pointer; }
.terms-check input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.terms-check:focus-within { border-color: rgba(63, 224, 255, 0.6); }
.terms-check:has(input:checked) { border-color: rgba(63, 224, 140, 0.8); background: rgba(63, 224, 140, 0.08); }
.terms-check a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.terms-check a:focus-visible { outline-offset: 1px; }
.terms-note { color: var(--muted); font-size: 14px; padding: 0 2px; }


.send-result:empty { display: none; }
.send-result { margin-top: 18px; }
.check-ok {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px;
  background: rgba(63, 224, 140, 0.1); border: 1px solid rgba(63, 224, 140, 0.45);
}
.check-ok strong { display: block; color: var(--green); font-size: 17px; }
.check-ok p { color: var(--muted); margin-top: 2px; }
.check-icon {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: #0d2a1a; font-weight: 700; font-size: 18px;
}
.success {
  padding: 22px; border-radius: 18px; text-align: center;
  background: radial-gradient(400px 160px at 50% 0%, rgba(63, 224, 140, 0.18), transparent), rgba(10, 4, 26, 0.45);
  border: 1px solid rgba(63, 224, 140, 0.5);
  box-shadow: 0 0 30px rgba(63, 224, 140, 0.15);
}
.success h3 { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 0.03em; color: var(--green); margin-top: 8px; }
.success p { color: var(--muted); margin-top: 6px; }
.success-icon {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #0b2a1a;
  background: linear-gradient(135deg, #7dffb8, var(--green)); box-shadow: 0 0 24px rgba(63, 224, 140, 0.45);
}
.success .success-lead { color: var(--text); font-size: 18px; font-weight: 600; }
.success .success-how { font-size: 16px; }
.success .success-how strong { color: var(--text); }
.success .success-foot { font-size: 13px; margin-top: 14px; }

/* Owner 2026-10-10: "song sent" is a dialog over the page, clean (one card, no boxes inside):
   the check, the gold title, the song, one line on where to find it, the inbox; the brand's
   pink / purple / cyan only as a thin top edge, confetti behind the card. No footer line. */
.sent-dialog {
  border: none; padding: 0; background: transparent; color: var(--text); overflow: visible;
  width: min(420px, calc(100vw - 32px)); max-width: none; max-height: none;
}
.sent-dialog::backdrop { background: rgba(6, 2, 16, 0.8); backdrop-filter: blur(4px); }
.sent-dialog .confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 0; }
.sent-card {
  position: relative; z-index: 1; text-align: center; overflow: visible;
  margin-top: 32px; padding: 46px 26px 24px; border-radius: 22px;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  border: 1px solid var(--line2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: sent-pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.sent-card::before {
  content: ''; position: absolute; left: 22px; right: 22px; top: -1px; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--pink), #8b5cf6, var(--cyan));
}
.sent-badge {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #7dffb8, var(--green));
  box-shadow: 0 0 0 6px var(--bg2), 0 8px 24px rgba(63, 224, 140, 0.45);
}
.sent-badge span {
  font-size: 34px; font-weight: 700; color: #0b2a1a; line-height: 1;
  animation: sent-check 0.5s 0.18s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.sent-title {
  font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 0.03em; line-height: 1.05;
  color: var(--gold);
}
.sent-name { margin-top: 14px; font-size: 19px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.sent-lead { margin-top: 4px; font-size: 15px; color: var(--muted); }
.sent-rule { border: 0; border-top: 1px solid var(--line); margin: 20px 0 18px; }
.sent-how { font-size: 15px; color: var(--muted); line-height: 1.5; }
.sent-path { color: var(--gold); font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.sent-inbox { margin-top: 18px; text-align: left; }
.sent-inbox-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.sent-bar { height: 6px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.sent-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width 0.8s 0.3s ease; }
.sent-next { margin-top: 10px; font-size: 13px; color: var(--faint); }
.sent-close { margin-top: 22px; width: 100%; justify-content: center; }
@keyframes sent-pop { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes sent-check { from { opacity: 0; transform: scale(0.3) rotate(-20deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sent-card, .sent-badge span { animation: none; }
  .sent-bar i { transition: none; }
}
.site-player .foot { display: none; }

/* Owner 2026-10-10: a clean community page. The header is the logo and the language only (no
   backend status, no site pill), a song only needs its name, no Duo view. */
.site-player .topbar .status, .site-player .topbar .brand-sub { display: none !important; }
.not-used { display: none !important; }
.advanced-settings { border-top: 1px solid var(--line); padding-top: 12px; }
.advanced-settings > summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.advanced-settings[open] > summary { margin-bottom: 14px; }
.advanced-settings > .form-grid { margin-top: 4px; }
.stats-simple { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Phones: keys and length side by side, the difficulty pill (name + stars) on its own row; three
   columns pushed the pill past the screen edge and made the page scroll sideways. */
@media (max-width: 640px) {
  .stats-simple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-simple > .stat:nth-child(3) { grid-column: 1 / -1; }
}

