:root {
  --ink: #0d1726;
  --ink-2: #15233a;
  --ink-3: #203250;
  --paper: #f4f1e9;
  --paper-bright: #fffdf8;
  --warm: #f4b64e;
  --warm-2: #ffd47e;
  --aqua: #68d5c8;
  --muted: #aab7c9;
  --line: rgba(255, 255, 255, 0.13);
  --serif: Georgia, "Times New Roman", serif;
  --shadow: 0 22px 55px rgba(2, 7, 17, 0.28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #808080; }
body {
  min-height: 100vh;
  margin: 0;
  color: #edf2f7;
  background: #808080;
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }

.game-app { width: min(1180px, calc(100% - 38px)); margin: 0 auto; padding: 22px 0 34px; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 2px 17px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
.brand h1 { margin: 0; color: #fff; font: 400 23px/1 var(--serif); letter-spacing: -0.025em; }
.saved-pill { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.saved-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 9px rgba(104, 213, 200, 0.8); }

.game-layout {
  display: grid;
  grid-template-columns: minmax(245px, 30%) minmax(0, 70%);
  grid-template-areas: "setup player" "answer answer";
  gap: 12px;
  align-items: stretch;
}
.setup-column { grid-area: setup; display: grid; grid-template-rows: auto 1fr; gap: 12px; min-width: 0; }
.listen-zone { grid-area: player; min-width: 0; }
.answer-zone { grid-area: answer; }

.setup-card, .answer-zone { overflow: hidden; border-radius: 17px; color: var(--ink); background: var(--paper-bright); box-shadow: 0 10px 25px rgba(29, 39, 53, 0.08); }
.setup-card { padding: 16px 14px; }
.setup-heading { display: flex; align-items: center; gap: 9px; }
.setup-heading > div { min-width: 0; }
.block-number {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid #b9c6d4;
  border-radius: 9px;
  color: #31516e;
  font: 800 10px/1 ui-monospace, monospace;
}
.block-number.dark { border-color: rgba(104, 213, 200, 0.5); color: var(--aqua); background: rgba(104, 213, 200, 0.06); }
.setup-heading small { display: block; color: #6e7b8c; font-size: 9px; font-weight: 800; letter-spacing: 0.1em; }
.setup-heading strong { display: block; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.collapse-toggle { display: none; margin-left: auto; width: 31px; height: 31px; border: 1px solid #d7dde3; border-radius: 9px; color: #31516e; background: #f3f6f8; font-weight: 900; }

.folder-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  margin: 17px 0 11px;
  padding: 10px 9px;
  border: 1px dashed #d5bd8a;
  border-radius: 10px;
  color: var(--ink);
  background: #fff9ed;
  text-align: left;
}
.folder-summary:hover { border-color: #b88a31; background: #fff3d7; }
.folder-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--warm); font: 18px/1 var(--serif); }
.folder-summary strong, .folder-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-summary strong { font-size: 10px; }
.folder-summary small { margin-top: 2px; color: #768398; font-size: 8px; }
.picker-arrow { color: #3d837b; font-weight: 900; }
.saved-note { display: flex; gap: 6px; margin: 10px 0 0; color: #8290a3; font-size: 8px; line-height: 1.3; }
.saved-note > span:first-child { color: #b17a20; font-size: 13px; }
.subfolder-check { display: flex; align-items: center; gap: 7px; margin: 1px 0 0; color: var(--ink); font-size: 10px; font-weight: 800; cursor: pointer; }
.subfolder-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--warm); }

.time-list { margin-top: 16px; padding-top: 2px; border-top: 1px solid #e6e1d8; }
.time-control { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 12px; color: #526179; font-size: 9px; font-weight: 750; }
.time-control > span:last-child { display: flex; align-items: center; gap: 3px; }
.time-control button { width: 23px; height: 23px; padding: 0; border: 1px solid #d3dae2; border-radius: 7px; color: #31516e; background: #f3f6f8; font-weight: 900; }
.time-control input { width: 38px; height: 27px; padding: 0 2px; border: 0; outline: 0; color: #1d2c45; background: transparent; font: 700 17px/1 var(--serif); text-align: center; -moz-appearance: textfield; }
.time-control input::-webkit-inner-spin-button, .time-control input::-webkit-outer-spin-button { margin: 0; }
.time-control em { color: #8a95a4; font-size: 8px; font-style: normal; }

.player-card { min-height: 352px; padding: 14px 18px 15px; border-radius: 17px; background: linear-gradient(145deg, #233454, #121d31); box-shadow: 0 16px 30px rgba(23, 35, 55, 0.22); }
.player-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.player-heading-copy { display: grid; gap: 6px; }
.player-title { display: flex; align-items: center; gap: 8px; }
.player-title strong, .answer-heading > strong { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; line-height: 1; }
.round-label { display: flex; align-items: center; gap: 6px; margin-left: 35px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: 0.1em; }
.round-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 8px rgba(104, 213, 200, 0.8); }
.time-readout { color: var(--warm-2); font: 700 18px/1 var(--serif); white-space: nowrap; }
.time-readout small { color: #8999ae; font: 400 10px/1 ui-sans-serif, system-ui; }
.player-stage { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; height: 142px; }
.main-play-control {
  position: relative;
  z-index: 2;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  align-content: center;
  gap: 4px;
  margin: auto;
  border: 1px solid rgba(104, 213, 200, 0.85);
  border-radius: 50%;
  color: #fff;
  background: #17243b;
  box-shadow: 0 0 0 8px rgba(104, 213, 200, 0.06), 0 14px 30px rgba(0, 0, 0, 0.25);
}
.main-play-control > span { color: var(--aqua); font-size: 25px; line-height: 1; }
.main-play-control small { color: #c8d2df; font-size: 8px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.speed-control { display: grid; justify-items: center; gap: 7px; width: min(150px, 100%); margin: auto; }
.speed-label { color: #a8b3c3; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.speed-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; width: 100%; gap: 7px; }
.speed-row button { width: 30px; height: 30px; padding: 0; border: 1px solid rgba(104, 213, 200, 0.65); border-radius: 50%; color: var(--aqua); background: #17243b; font-size: 18px; font-weight: 900; line-height: 1; }
.speed-range { width: 100%; height: 5px; margin: 0; accent-color: var(--warm); }
.speed-value { color: var(--warm-2); font: 700 18px/1 var(--serif); }
.visualizer { display: flex; align-items: center; justify-content: center; gap: 7px; height: 82px; }
.visualizer i { width: 5px; height: 30%; border-radius: 99px; background: linear-gradient(var(--warm), var(--aqua)); opacity: 0.72; transform-origin: center; }
.visualizer i:nth-child(2n) { height: 54%; }
.visualizer i:nth-child(3n) { height: 82%; }
.visualizer i:nth-child(5n) { height: 42%; }
.visualizer.playing i { animation: pulse-wave 720ms ease-in-out infinite alternate; }
.visualizer.playing i:nth-child(2n) { animation-delay: -240ms; }
.visualizer.playing i:nth-child(3n) { animation-delay: -460ms; }
@keyframes pulse-wave { to { transform: scaleY(0.45); opacity: 1; } }

.timeline-labels, .timeline-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timeline-labels { color: #a8b3c3; font-size: 9px; }
.timeline-labels span:last-child { color: var(--warm-2); font-weight: 800; }
.timeline {
  --progress: 0%;
  width: 100%;
  height: 4px;
  margin: 8px 0 0;
  border-radius: 99px;
  outline: 0;
  background: linear-gradient(to right, var(--warm) 0 var(--progress), rgba(255, 255, 255, 0.28) var(--progress) 100%);
  appearance: none;
}
.timeline::-webkit-slider-runnable-track { height: 4px; background: transparent; }
.timeline::-webkit-slider-thumb { width: 15px; height: 15px; margin-top: -5px; border: 0; border-radius: 50%; background: var(--warm); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28); appearance: none; }
.timeline::-moz-range-track { height: 4px; background: transparent; }
.timeline::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: var(--warm); }
.timeline-hint { justify-content: flex-end; margin-top: 4px; color: #79889e; font-size: 8px; }
.player-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 11px; }
.action-button { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-height: 50px; padding: 7px 8px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; color: #e4eaf1; background: rgba(255, 255, 255, 0.05); text-align: left; }
.action-button > span { grid-row: 1 / span 2; display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid currentColor; border-radius: 50%; color: var(--aqua); font-weight: 900; }
.action-button strong { font-size: 9px; line-height: 1.1; }
.action-button small { color: #90a0b5; font-size: 8px; line-height: 1.15; }
.status { min-height: 15px; margin: 8px 0 0; color: #9caabd; font-size: 8px; text-align: center; }

.answer-zone { overflow: hidden; }
.answer-heading { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 13px 16px; background: linear-gradient(135deg, #1c2a44, #101a2b); }
.answer-list { background: var(--paper-bright); }
.answer-row { display: grid; grid-template-columns: 126px 72px minmax(0, 1fr); align-items: center; column-gap: 12px; min-height: 70px; padding: 11px 18px; border-bottom: 1px solid #e4ded3; }
.answer-control { display: contents; }
.answer-control button { grid-column: 1; width: 126px; margin: 0; padding: 8px 10px; border: 1px solid #263550; border-left: 3px solid var(--warm); border-radius: 7px; color: #fff; background: #20304b; font-size: 9px; font-weight: 900; white-space: nowrap; }
.answer-control small { grid-column: 2; color: #3d837b; font-size: 8px; font-weight: 900; letter-spacing: 0.14em; }
.answer-value { grid-column: 3; min-width: 0; margin: 0; color: #17243b; overflow-wrap: anywhere; font: 600 15px/1.25 var(--serif); }
.answer-value.empty::after { content: "Aún no revelado"; color: #676662; font-style: italic; font-weight: 400; }
.file-row .answer-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.file-row .answer-value.empty::after { font-family: var(--serif); font-size: 15px; }
.next-song { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 9px; width: min(330px, calc(100% - 28px)); margin: 13px auto; padding: 9px 13px; border: 1px solid #e1b45f; border-radius: 10px; color: #17243b; background: #fff1d2; text-align: left; box-shadow: 0 8px 18px rgba(74, 52, 16, 0.1); }
.next-song > span:first-child { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: var(--warm); font-weight: 900; }
.next-song strong, .next-song small { display: block; }
.next-song strong { color: #4c3410; font-size: 11px; }
.next-song small { color: #8a6c35; font-size: 8px; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (min-width: 721px) {
  body { font-size: 25px; }
  .listen-zone { display: flex; }
  .player-card { display: flex; flex: 1; flex-direction: column; height: 100%; }
  .player-stage { flex: 1; }
  .block-number { font-size: 15px; }
  .setup-heading small { font-size: 15px; }
  .setup-heading strong { font-size: 18px; }
  .folder-summary strong { font-size: 15px; }
  .folder-summary small, .saved-note { font-size: 11px; }
  .subfolder-check { font-size: 15px; }
  .time-control { font-size: 15px; }
  .time-control em { font-size: 11px; }
  .player-title strong { font-size: 15px; }
  .round-label { font-size: 12px; }
  .time-readout small { font-size: 18px; }
  .main-play-control small { font-size: 10px; }
  .timeline-labels { font-size: 12px; }
  .timeline-hint { font-size: 11px; }
  .action-button strong { font-size: 12px; }
  .action-button small { font-size: 10px; }
  .action-button > span { font-size: 15px; line-height: 1; text-align: center; }
  .status { font-size: 10px; }
  .answer-heading > strong { font-size: 18px; }
  .answer-row { grid-template-columns: 180px 100px minmax(0, 1fr); column-gap: 16px; }
  .answer-control button { width: 180px; font-size: 14px; }
  .answer-control small { font-size: 12px; }
  .next-song strong { font-size: 15px; }
  .next-song small { font-size: 11px; }
}

@media (max-width: 720px) {
  .game-app { width: min(100% - 18px, 560px); padding: 10px 0 18px; }
  .app-topbar { padding-bottom: 9px; }
  .brand img { width: 27px; height: 27px; border-radius: 8px; }
  .brand h1 { font-size: 19px; white-space: nowrap; }
  .saved-pill { font-size: 0; }
  .saved-pill span { width: 8px; height: 8px; }
  .game-layout { display: grid; grid-template-columns: 1fr; grid-template-areas: "setup" "player" "answer"; gap: 8px; }
  .setup-column { display: grid; grid-template-rows: auto auto; gap: 6px; }
  .setup-card { padding: 8px 10px; border: 1px solid #e0dacd; border-radius: 10px; }
  .setup-heading { gap: 8px; }
  .setup-heading .block-number { width: 23px; height: 23px; font-size: 9px; }
  .setup-heading small { color: #528d86; font-size: 8px; font-weight: 900; }
  .setup-heading strong { font-size: 10px; }
  .collapse-toggle { display: grid; place-items: center; }
  .collapsible-panel.is-collapsed .collapsible-content { display: none; }
  .collapsible-panel:not(.is-collapsed) { padding-bottom: 12px; }
  .collapsible-panel:not(.is-collapsed) .collapse-toggle span { transform: rotate(180deg); }
  .folder-summary { margin-top: 11px; }
  .time-list { margin-top: 11px; }

  .player-card { min-height: 0; padding: 12px 12px 10px; border-radius: 14px; }
  .player-heading-copy { gap: 5px; }
  .player-title { gap: 7px; }
  .player-title .block-number { width: 23px; height: 23px; font-size: 9px; }
  .player-title strong { font-size: 8px; font-weight: 900; }
  .round-label { margin-left: 30px; font-size: 7px; }
  .time-readout { font-size: 13px; }
  .time-readout small { font-size: 8px; }
  .player-stage { height: 105px; }
  .main-play-control { width: 62px; height: 62px; gap: 2px; box-shadow: 0 0 0 6px rgba(104, 213, 200, 0.06), 0 10px 20px rgba(0, 0, 0, 0.25); }
  .main-play-control > span { font-size: 20px; }
  .main-play-control small { font-size: 7px; }
  .visualizer { height: 70px; gap: 4px; }
  .visualizer i { width: 3px; }
  .speed-control { width: 100px; gap: 5px; }
  .speed-label { font-size: 8px; }
  .speed-row { grid-template-columns: 24px minmax(0, 1fr) 24px; gap: 4px; }
  .speed-row button { width: 24px; height: 24px; font-size: 15px; }
  .speed-value { font-size: 16px; }
  .timeline-labels { font-size: 8px; }
  .timeline-hint { display: none; }
  .player-actions { gap: 5px; margin-top: 10px; }
  .action-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 5px 2px; text-align: center; }
  .action-button > span { flex: 0 0 auto; width: 21px; height: 21px; font-size: 11px; }
  .action-button strong { font-size: 7px; }
  .action-button small { display: none; }
  .status { margin-top: 6px; font-size: 7px; }

  .answer-zone { border-radius: 14px; }
  .answer-heading { min-height: 45px; padding: 10px 145px 10px 12px; }
  .answer-heading .block-number { width: 23px; height: 23px; font-size: 9px; }
  .answer-heading > strong { font-size: 8px; font-weight: 900; }
  .answer-row { display: block; min-height: 0; padding: 8px 12px; }
  .answer-control { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
  .answer-control button { order: 2; width: auto; min-width: 122px; min-height: 33px; padding: 6px 9px; border-radius: 8px; font-size: 8px; }
  .answer-control small { order: 1; font-size: 7px; }
  .answer-value { margin-top: 2px; font-size: 12px; line-height: 1.1; }
  .answer-value.empty::after, .file-row .answer-value.empty::after { font-size: 11px; }
  .file-row .answer-value { font-size: 10px; }
  .answer-zone { position: relative; }
  .next-song { position: absolute; top: 5px; right: 8px; z-index: 1; width: auto; margin: 0; padding: 5px 8px; gap: 5px; }
  .next-song > span:first-child { width: 23px; height: 23px; }
  .next-song strong { font-size: 9px; }
  .next-song small { display: none; }
}

@media (max-width: 390px) {
  .game-app { width: calc(100% - 12px); }
  .brand h1 { font-size: 17px; }
  .player-actions { gap: 4px; }
  .action-button strong { font-size: 6.5px; }
  .answer-control button { min-width: 116px; font-size: 7.5px; }
}

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