:root {
  --ink: #f3e7cf;
  --muted: #b9a78d;
  --gold: #d7a85f;
  --gold-bright: #f0c982;
  --brown: #1b0e08;
  --panel: #28170e;
  --panel-light: #362014;
  --line: rgba(225, 184, 116, .27);
  --green: #9aa96a;
  --serif: "Playfair Display", Georgia, serif;
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--brown); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--mono);
  background:
    radial-gradient(ellipse at 50% 15%, rgba(112, 63, 29, .31), transparent 48%),
    linear-gradient(135deg, #1a0d07 0%, #28150c 49%, #160a06 100%);
  overflow-x: hidden;
}
button, input { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(70px); opacity: .12; }
.ambient-one { width: 350px; height: 350px; left: -150px; top: 35%; background: #b66c2f; }
.ambient-two { width: 430px; height: 430px; right: -210px; top: 8%; background: #7c4526; }

.topbar {
  min-height: 76px;
  padding: 0 clamp(18px, 5vw, 76px);
  display: grid;
  grid-template-columns: 1fr minmax(220px, 430px) 1fr;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid rgba(223, 181, 113, .17);
  background: rgba(16, 8, 4, .45);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-bright); font-size: 24px; box-shadow: inset 0 0 14px rgba(215,168,95,.12), 0 0 18px rgba(215,168,95,.08); }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-family: var(--serif); letter-spacing: .15em; font-size: 13px; }
.brand-copy small { color: #a58c6d; font-size: 9px; letter-spacing: .11em; }
.search-box { height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid rgba(222, 182, 116, .25); border-radius: 3px; background: rgba(255,255,255,.035); transition: border-color .2s, background .2s; }
.search-box:focus-within { border-color: var(--gold); background: rgba(255,255,255,.065); }
.search-icon { color: var(--gold); font-size: 25px; line-height: 1; transform: rotate(-15deg); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; letter-spacing: .04em; }
.search-box input::placeholder { color: #b8aa99; opacity: .72; }
.search-box input::-webkit-search-cancel-button { display: none; }
.clear-search { border: 0; padding: 0 2px; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.login-button { border: 1px solid var(--gold); border-radius: 2px; padding: 9px 17px; color: var(--gold-bright); background: transparent; text-transform: uppercase; letter-spacing: .14em; font-size: 10px; cursor: pointer; transition: background .2s, color .2s; }
.login-button:hover { color: #1b1008; background: var(--gold-bright); }
.admin-indicator { color: var(--green); font-size: 9px; letter-spacing: .13em; }

.main-content { width: min(1360px, calc(100% - 42px)); margin: 0 auto; padding: 42px 0 35px; }
.intro-row { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin: 0 auto 28px; width: min(1160px, 100%); }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 9px; letter-spacing: .28em; }
h1, h2 { font-family: var(--serif); }
.intro-row h1 { margin: 0; font-size: clamp(29px, 4vw, 47px); line-height: 1.11; letter-spacing: -.025em; font-weight: 600; }
.intro-row h1 em { color: var(--gold-bright); font-weight: 600; }
.intro-note { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; color: #ae9879; font-size: 10px; line-height: 1.7; }
.note-symbol { font-family: var(--serif); color: var(--gold); font-size: 35px; }

.jukebox-frame {
  position: relative;
  width: min(1160px, 100%);
  margin: auto;
  padding: 15px 20px 0;
  border: 1px solid rgba(222, 177, 108, .53);
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(66, 39, 23, .97), rgba(27, 14, 8, .98) 60%);
  box-shadow: 0 23px 70px rgba(0,0,0,.38), inset 0 0 0 5px rgba(215,168,95,.045), inset 0 0 40px rgba(0,0,0,.38);
}
.jukebox-frame::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(222,177,108,.12); border-radius: 2px; pointer-events: none; }
.frame-topline, .frame-bottomline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: #a99070; font-size: 8px; letter-spacing: .2em; }
.frame-topline { padding: 0 4px 13px; }
.frame-light { display: flex; align-items: center; gap: 8px; }
.frame-light i, .admin-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #92a46b; box-shadow: 0 0 8px #92a46b; }
.book-wrap { position: relative; min-height: 514px; border: 1px solid rgba(219,176,109,.29); background: #e7d9bd; box-shadow: inset 0 0 30px rgba(72,41,19,.2), 0 4px 18px rgba(0,0,0,.24); overflow: hidden; }
.book { min-height: 514px; display: grid; grid-template-columns: 1fr 1fr; color: #352316; perspective: 1600px; transform-style: preserve-3d; }
.book-page { position: relative; min-width: 0; padding: 19px 20px 16px; background:
  radial-gradient(ellipse at 50% 50%, rgba(255,255,255,.33), transparent 75%),
  repeating-linear-gradient(0deg, rgba(104,72,40,.018) 0, rgba(104,72,40,.018) 1px, transparent 1px, transparent 4px),
  #eadfc9; }
.page-left { border-right: 1px solid rgba(77,48,26,.25); box-shadow: inset -12px 0 18px -18px #38210f; }
.page-right { box-shadow: inset 12px 0 18px -18px #38210f; }
.page-label { height: 21px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(91,59,31,.2); color: #98764b; font-size: 8px; letter-spacing: .19em; }
.page-flourish { color: #b28b54; font-size: 14px; }
.page-albums { display: grid; grid-template-rows: 1fr 1fr; min-height: 450px; }
.book-spine { position: absolute; top: 0; bottom: 0; left: 50%; z-index: 2; width: 14px; transform: translateX(-50%); pointer-events: none; background: linear-gradient(90deg, rgba(62,37,20,.25), rgba(255,255,255,.28) 38%, rgba(53,31,17,.24)); }
.book-spine span { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-90deg); white-space: nowrap; color: rgba(92,62,32,.55); font-size: 7px; letter-spacing: .25em; }
.album-panel { display: grid; grid-template-columns: minmax(112px, 39%) minmax(0, 1fr); gap: 15px; min-height: 211px; padding: 14px 5px 13px; border-bottom: 1px solid rgba(100,67,36,.19); position: relative; transition: background .2s; }
.album-panel:last-child { border-bottom: 0; }
.album-panel.is-selected { background: rgba(184,139,76,.10); outline: 1px solid rgba(166,119,58,.38); outline-offset: -2px; }
.album-panel.is-selected::before { content: "▶"; position: absolute; z-index: 3; top: 17px; left: -3px; color: #a26c30; font-size: 9px; }
.cover-column { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.cover-wrap { position: relative; width: min(100%, 164px); aspect-ratio: 1; overflow: hidden; background: linear-gradient(140deg, #69462e, #25150c); box-shadow: 0 5px 11px rgba(49,30,14,.27); cursor: pointer; }
.cover-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s, opacity .2s; }
.cover-wrap:hover img { transform: scale(1.045); }
.cover-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(239,207,151,.8); background: radial-gradient(circle at 50% 45%, #8d6840, #392318 68%, #24140c); }
.cover-placeholder::before { content: ""; position: absolute; width: 72%; height: 72%; border: 1px solid rgba(242,208,149,.45); border-radius: 50%; box-shadow: 0 0 0 7px rgba(242,208,149,.06), 0 0 0 14px rgba(242,208,149,.05); }
.cover-placeholder span { z-index: 1; font-family: var(--serif); font-size: 47px; }
.cover-caption { color: #92734d; font-size: 7px; letter-spacing: .16em; text-align: center; }
.album-info { min-width: 0; display: flex; flex-direction: column; }
.album-artist { margin: 1px 0 4px; color: #9a7549; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; overflow-wrap: anywhere; }
.album-title { margin: 0; color: #342315; font-family: var(--serif); font-size: clamp(13px, 1.35vw, 18px); line-height: 1.17; overflow-wrap: anywhere; }
.album-year { margin: 5px 0 7px; color: #94734f; font-size: 8px; }
.track-list { min-height: 0; display: flex; flex-direction: column; gap: 2px; overflow: auto; scrollbar-width: thin; scrollbar-color: #c4a77a transparent; }
.track-row { width: 100%; min-width: 0; min-height: 22px; display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 5px; padding: 3px 4px; border: 0; border-radius: 2px; color: #59432c; text-align: left; background: transparent; cursor: pointer; font-size: 8px; transition: background .15s, color .15s; }
.track-row:hover { background: rgba(157,111,55,.13); color: #24180e; }
.track-row.is-current { color: #4d2c13; background: rgba(185,137,70,.21); font-weight: 500; }
.track-number { color: #a18055; font-size: 8px; text-align: right; }
.track-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.track-playing { color: #9b6a32; font-size: 9px; }
.no-tracks { margin: 10px 0 0; color: #a18b70; font-family: var(--serif); font-size: 12px; font-style: italic; }
.admin-card-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 8px; }
.mini-admin-button { border: 1px solid rgba(132,92,47,.32); padding: 4px 6px; background: rgba(255,255,255,.2); color: #76532f; font-size: 7px; letter-spacing: .07em; cursor: pointer; }
.mini-admin-button:hover { background: rgba(184,137,70,.2); }
.album-panel-empty { min-height: 210px; display: grid; place-items: center; border-bottom: 1px solid rgba(100,67,36,.13); color: rgba(116,89,57,.4); font-family: var(--serif); font-size: 13px; font-style: italic; }

.frame-bottomline { min-height: 48px; padding: 0 4px; }
.page-control { border: 0; padding: 9px 4px; background: transparent; color: #c1a174; cursor: pointer; font-size: 20px; }
.page-control span { font-size: 8px; letter-spacing: .16em; vertical-align: 3px; }
.page-control:disabled { opacity: .25; cursor: default; }
.page-counter { display: flex; align-items: center; gap: 11px; color: #d6b47e; font-size: 9px; letter-spacing: .1em; }
.page-counter i { width: 28px; height: 1px; background: rgba(214,180,126,.45); }
.empty-state { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; flex-direction: column; background: rgba(234,223,201,.96); color: #503a24; text-align: center; }
.empty-record { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 12px; border: 1px solid #b28b54; border-radius: 50%; color: #a57942; font-size: 35px; }
.empty-state h2 { margin: 0 0 8px; font-size: 25px; }
.empty-state p, .empty-admin-hint { margin: 0; color: #917451; font-size: 10px; }
.empty-admin-hint { margin-top: 9px; color: #76552f; }
.book.turn-next .page-right { animation: turn-next .68s cubic-bezier(.3,.72,.28,1) both; transform-origin: left center; }
.book.turn-previous .page-left { animation: turn-previous .68s cubic-bezier(.3,.72,.28,1) both; transform-origin: right center; }
@keyframes turn-next { 0% { transform: rotateY(0); } 45% { box-shadow: 8px 8px 20px rgba(0,0,0,.25); } 100% { transform: rotateY(-150deg); } }
@keyframes turn-previous { 0% { transform: rotateY(0); } 45% { box-shadow: -8px 8px 20px rgba(0,0,0,.25); } 100% { transform: rotateY(150deg); } }

.admin-toolbar { width: min(1160px, 100%); margin: 17px auto 0; padding: 12px 15px; border: 1px solid rgba(151,171,107,.32); display: flex; align-items: center; justify-content: space-between; gap: 15px; background: rgba(111,130,75,.08); }
.admin-toolbar > div { display: flex; align-items: center; gap: 9px; }
.admin-toolbar strong { color: #bbc98d; font-size: 9px; letter-spacing: .12em; }
.admin-toolbar small { color: #a4977e; font-size: 9px; }
.gold-button { border: 1px solid #d4a85f; border-radius: 2px; padding: 10px 15px; color: #24170d; background: linear-gradient(135deg, #edc77f, #c18d47); font-size: 10px; letter-spacing: .06em; cursor: pointer; box-shadow: 0 2px 7px rgba(0,0,0,.12); }
.gold-button:hover { filter: brightness(1.08); }
.keyboard-hint { width: min(1160px, 100%); margin: 20px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 17px; color: #9e896b; font-size: 8px; letter-spacing: .05em; }
kbd { display: inline-grid; min-width: 19px; height: 18px; place-items: center; margin-right: 3px; border: 1px solid rgba(214,180,126,.33); border-radius: 2px; color: #c3a77c; font-family: var(--mono); font-size: 8px; }
.hint-right { margin-left: auto; color: #756047; letter-spacing: .2em; }

.player-layer { position: fixed; inset: 0 auto auto 0; z-index: 20; width: 0; height: 0; pointer-events: none; }
.player-shell { position: fixed; left: 0; top: 0; width: 10px; height: 10px; overflow: hidden; background: #090706; box-shadow: 0 5px 18px rgba(0,0,0,.45); pointer-events: auto; transition: left .22s, top .22s, width .22s, height .22s; }
.player-shell.is-docked { border: 1px solid rgba(232,190,120,.75); }
.player-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 4; min-height: 25px; padding: 4px 6px; display: flex; align-items: center; justify-content: space-between; color: #f2dfbd; background: linear-gradient(rgba(0,0,0,.76), transparent); opacity: 0; transition: opacity .2s; pointer-events: none; }
.player-shell:hover .player-topbar, .player-shell:fullscreen .player-topbar { opacity: 1; }
.player-topbar span { font-size: 7px; letter-spacing: .16em; }
.player-topbar button { border: 1px solid rgba(242,223,189,.6); padding: 4px 7px; color: #fff3da; background: rgba(0,0,0,.45); font-size: 9px; cursor: pointer; pointer-events: auto; }
.youtube-player-host, .youtube-player-host iframe { width: 100%; height: 100%; display: block; border: 0; }
.player-shell:fullscreen { width: 100vw !important; height: 100vh !important; left: 0 !important; top: 0 !important; border: 0; box-shadow: none; background: #000; }
.player-shell:fullscreen .player-topbar { min-height: 42px; padding: 9px 13px; opacity: 1; }
.player-shell:fullscreen .player-topbar span { font-size: 10px; }
.player-shell:fullscreen .player-topbar button { padding: 7px 12px; font-size: 11px; }

.modal { width: min(440px, calc(100% - 28px)); max-width: none; padding: 0; border: 1px solid rgba(220,178,110,.55); border-radius: 4px; color: var(--ink); background: #26160d; box-shadow: 0 25px 90px rgba(0,0,0,.65); }
.modal::backdrop { background: rgba(8,4,2,.78); backdrop-filter: blur(4px); }
.modal-card { position: relative; padding: 30px; }
.modal-x { position: absolute; top: 10px; right: 13px; border: 0; color: #c7aa7c; background: transparent; font-size: 24px; cursor: pointer; }
.modal-card h2 { margin: 0 0 8px; font-size: 27px; }
.modal-description { margin: 0 0 21px; color: #b5a187; font-size: 10px; line-height: 1.7; }
.field-label { display: block; margin: 12px 0 7px; color: #d5b783; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.text-field { display: block; width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid rgba(215,168,95,.3); border-radius: 2px; outline: 0; color: var(--ink); background: rgba(255,255,255,.045); font-size: 11px; }
.text-field:focus { border-color: var(--gold); }
.text-field::placeholder { color: #89775f; }
.form-error { min-height: 14px; margin: 8px 0 0; color: #e69a79; font-size: 9px; line-height: 1.5; }
.modal-submit { width: 100%; margin-top: 8px; }
.editor-card { padding-top: 27px; }
.editor-card h2 { margin-bottom: 8px; }
.editor-intro { margin: 0 0 15px; color: #b5a187; font-size: 9px; line-height: 1.6; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-full { grid-column: 1 / -1; }
.file-field { width: 100%; color: #c2ad8c; font-size: 9px; }
.file-field::file-selector-button { margin-right: 9px; border: 1px solid rgba(215,168,95,.5); padding: 7px 9px; color: #e3c28b; background: rgba(255,255,255,.04); cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.plain-button { border: 1px solid rgba(215,168,95,.3); padding: 9px 13px; color: #c8b18c; background: transparent; font-size: 10px; cursor: pointer; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: calc(100% - 30px); padding: 10px 15px; border: 1px solid rgba(225,184,116,.48); color: #f1dfbd; background: #2d1b10; box-shadow: 0 8px 25px rgba(0,0,0,.3); font-size: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .topbar { grid-template-columns: 1fr auto; gap: 12px; padding: 12px 18px; }
  .search-box { grid-column: 1 / -1; grid-row: 2; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .admin-indicator { display: none; }
  .main-content { padding-top: 30px; }
  .book-wrap, .book { min-height: 0; }
  .page-albums { min-height: 405px; }
  .book-page { padding: 14px 12px 10px; }
  .album-panel { grid-template-columns: minmax(80px, 37%) minmax(0,1fr); gap: 9px; min-height: 190px; padding: 10px 3px; }
  .page-albums { min-height: 405px; }
  .track-row { font-size: 7px; grid-template-columns: 17px minmax(0,1fr) auto; }
  .cover-caption { font-size: 6px; }
  .book-spine { width: 9px; }
}
@media (max-width: 560px) {
  .main-content { width: calc(100% - 20px); padding-top: 24px; }
  .intro-row { align-items: flex-start; }
  .intro-row h1 { font-size: 30px; }
  .intro-note { display: none; }
  .jukebox-frame { padding: 12px 9px 0; }
  .book { grid-template-columns: 1fr; }
  .book-spine { display: none; }
  .book-page { padding: 12px 11px; }
  .page-right { border-top: 1px solid rgba(77,48,26,.32); }
  .page-albums { min-height: 0; }
  .album-panel { min-height: 176px; grid-template-columns: minmax(105px, 34%) minmax(0,1fr); gap: 12px; padding: 12px 5px; }
  .cover-wrap { width: min(100%, 145px); }
  .album-title { font-size: 16px; }
  .track-row { min-height: 22px; font-size: 8px; }
  .page-label { height: 18px; }
  .page-left .page-label::after { content: "LADO A"; color: #aa8556; }
  .page-right .page-label::after { content: "LADO B"; color: #aa8556; }
  .keyboard-hint { gap: 9px 12px; font-size: 7px; }
  .hint-right { display: none; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-toolbar small { display: none; }
  .frame-bottomline { min-height: 43px; }
  .player-shell.is-docked { width: min(250px, 58vw) !important; height: auto !important; aspect-ratio: 16 / 9; left: auto !important; right: 10px; bottom: 10px; top: auto !important; }
  .editor-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
}

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

/* Herramientas discretas para editar canciones desde el modo administrador. */
.track-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px; }
.track-admin-actions { display: flex; align-items: center; gap: 1px; }
.track-admin-actions button { width: 17px; height: 19px; padding: 0; border: 0; color: #8c6b45; background: transparent; cursor: pointer; font-size: 11px; }
.track-admin-actions button:hover { color: #3d2714; background: rgba(157,111,55,.15); }
.cover-wrap.cover-is-playing { outline: 1px solid rgba(190,141,71,.75); }
.track-list { max-height: 126px; }
@media (max-width: 850px) { .track-list { max-height: 112px; } }

/* Interfaz reducida: búsqueda, acceso y catálogo. */
.topbar {
  min-height: 70px;
  padding: 0 clamp(14px, 4vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.search-box {
  flex: 0 1 520px;
  width: min(520px, calc(100% - 110px));
  margin-right: auto;
}
.top-actions { margin-left: auto; gap: 10px; }
.admin-add-button {
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid rgba(215,168,95,.65);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(255,255,255,.035);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.admin-add-button:hover { background: rgba(215,168,95,.16); }
.main-content {
  width: min(1360px, calc(100% - 32px));
  padding: 18px 0 20px;
}
.jukebox-frame { padding-top: 10px; }
.frame-topline, .intro-row, .keyboard-hint, .admin-toolbar,
.page-label, .cover-caption, .page-counter, .page-control span,
.book-spine span, .admin-indicator { display: none !important; }
.book-wrap { min-height: 514px; }
.book { min-height: 514px; }
.page-albums { min-height: 478px; }
.frame-bottomline {
  min-height: 38px;
  padding: 0 2px;
  justify-content: space-between;
}
.page-control {
  min-width: 38px;
  min-height: 34px;
  padding: 0 8px;
  color: var(--gold-bright);
  font-size: 27px;
}
.album-panel-empty { min-height: 210px; border: 0; }
.no-tracks { display: none; }
.admin-card-actions { gap: 4px; padding-top: 6px; }
.mini-admin-button {
  min-width: 21px;
  min-height: 20px;
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1;
}
.player-topbar { justify-content: flex-end; }
.login-card { min-height: 145px; padding: 38px 28px 24px; }
.login-card .text-field { margin-top: 9px; }
.login-submit {
  display: block;
  width: 37px;
  height: 34px;
  margin: 12px 0 0 auto;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}
.login-submit:hover { color: #1b1008; background: var(--gold-bright); }
.login-card .form-error:empty { display: none; }
.toast { max-width: min(500px, calc(100% - 30px)); }

@media (max-width: 850px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 64px;
    padding: 10px 14px;
  }
  .search-box { grid-column: 1; grid-row: 1; width: 100%; min-width: 0; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .main-content { padding-top: 14px; }
  .book-wrap, .book { min-height: 0; }
  .page-albums { min-height: 405px; }
}
@media (max-width: 560px) {
  .main-content { width: calc(100% - 14px); padding-top: 10px; }
  .jukebox-frame { padding: 8px 7px 0; }
  .book { grid-template-columns: 1fr; }
  .book-spine { display: none; }
  .book-page { padding: 10px 9px; }
  .page-right { border-top: 1px solid rgba(77,48,26,.32); }
  .page-albums { min-height: 0; }
  .album-panel { min-height: 176px; grid-template-columns: minmax(105px, 34%) minmax(0,1fr); gap: 12px; padding: 12px 5px; }
  .cover-wrap { width: min(100%, 145px); }
  .frame-bottomline { min-height: 38px; }
}


/* Tema negro, blanco y azul: actualización visual */
:root {
  --ink: #f3f8ff;
  --muted: #a9c5e2;
  --gold: #459ff0;
  --gold-bright: #b7e0ff;
  --brown: #05080e;
  --panel: #0a1422;
  --panel-light: #10243a;
  --line: rgba(82, 174, 255, .34);
  --green: #79caff;
}

html { background: #05080e; }
body {
  color: #f3f8ff;
  background:
    radial-gradient(ellipse at 50% 8%, rgba(24, 91, 157, .20), transparent 48%),
    radial-gradient(ellipse at 50% 100%, rgba(12, 49, 91, .16), transparent 52%),
    linear-gradient(135deg, #03060b 0%, #080f1b 52%, #03060b 100%);
}
.ambient-one { background: #168cff; opacity: .10; }
.ambient-two { background: #245fa8; opacity: .12; }

/* Búsqueda centrada en la pantalla; acceso siempre arriba a la derecha. */
.topbar {
  position: relative;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px clamp(14px, 4vw, 58px);
  border-bottom: 1px solid rgba(82, 174, 255, .24);
  background: rgba(3, 8, 16, .88);
}
.search-box {
  flex: 0 1 520px;
  width: min(520px, calc(100% - 170px));
  min-width: 190px;
  margin: 0 auto;
  border: 1px solid rgba(105, 190, 255, .52);
  border-radius: 5px;
  background: rgba(11, 26, 45, .78);
  box-shadow: 0 0 0 1px rgba(36, 132, 218, .08), 0 0 22px rgba(21, 113, 202, .10);
}
.search-box:focus-within {
  border-color: #8bcfff;
  background: rgba(13, 33, 57, .96);
  box-shadow: 0 0 0 2px rgba(80, 172, 245, .13), 0 0 25px rgba(31, 137, 226, .20);
}
.search-icon { color: #9bd5ff; }
.search-box input { color: #f4f9ff; }
.search-box input::placeholder { color: #b5cce2; opacity: .76; }
.clear-search { color: #b9dcf8; }
.top-actions {
  position: absolute;
  top: 50%;
  right: clamp(14px, 4vw, 58px);
  transform: translateY(-50%);
  margin: 0;
  gap: 9px;
}
.login-button {
  border: 1px solid #5bb5ff;
  border-radius: 4px;
  color: #d7edff;
  background: rgba(22, 74, 120, .16);
  letter-spacing: .10em;
}
.login-button:hover { color: #04101d; background: #b7e0ff; }
.admin-add-button {
  border-color: rgba(105, 190, 255, .75);
  color: #c5e7ff;
  background: rgba(24, 91, 151, .18);
}
.admin-add-button:hover { background: rgba(56, 151, 226, .28); }

.main-content { padding-top: 18px; }
.jukebox-frame {
  border: 1px solid rgba(84, 172, 245, .66);
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(14, 31, 51, .99), rgba(3, 8, 16, .99) 68%);
  box-shadow: 0 23px 70px rgba(0,0,0,.55), inset 0 0 0 5px rgba(71, 160, 232, .055), inset 0 0 42px rgba(0,0,0,.55), 0 0 28px rgba(18, 92, 158, .10);
}
.jukebox-frame::before { border-color: rgba(126, 196, 255, .20); }
.book-wrap {
  border: 1px solid rgba(88, 174, 245, .40);
  background: #080f1b;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .48), 0 4px 18px rgba(0,0,0,.42);
}
.book { color: #f3f8ff; }
.book-page {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(30, 86, 139, .19), transparent 76%),
    repeating-linear-gradient(0deg, rgba(143, 199, 245, .018) 0, rgba(143, 199, 245, .018) 1px, transparent 1px, transparent 4px),
    linear-gradient(145deg, #101b2a, #080f1a 62%, #0b1726);
}
.page-left { border-right: 1px solid rgba(112, 190, 255, .25); box-shadow: inset -12px 0 18px -18px #000; }
.page-right { box-shadow: inset 12px 0 18px -18px #000; }
.book-spine { background: linear-gradient(90deg, rgba(0, 0, 0, .60), rgba(136, 202, 255, .18) 38%, rgba(0, 0, 0, .65)); }
.album-panel { border-bottom-color: rgba(117, 184, 239, .20); }
.album-panel.is-selected {
  background: rgba(39, 126, 201, .13);
  outline-color: rgba(106, 190, 255, .58);
}
.album-panel.is-selected::before { color: #8ed0ff; }
.cover-wrap {
  background: linear-gradient(140deg, #173b5e, #050a12);
  box-shadow: 0 5px 15px rgba(0,0,0,.48), 0 0 0 1px rgba(123, 194, 255, .25);
}
.cover-placeholder {
  color: rgba(207, 235, 255, .9);
  background: radial-gradient(circle at 50% 45%, #23517a, #10243a 68%, #050a12);
}
.cover-placeholder::before {
  border-color: rgba(194, 228, 255, .50);
  box-shadow: 0 0 0 7px rgba(122, 193, 248, .07), 0 0 0 14px rgba(122, 193, 248, .045);
}
.cover-caption { color: #a9d4f7; }
.album-artist { color: #8fcaff; }
.album-title { color: #f3f8ff; }
.album-year { color: #a8c9e8; }
.track-list { scrollbar-color: #397fb6 transparent; }
.track-row { color: #d5e8f8; }
.track-row:hover { color: #fff; background: rgba(55, 145, 220, .18); }
.track-row.is-current { color: #fff; background: rgba(61, 151, 226, .28); }
.track-number { color: #82bce9; }
.track-playing { color: #9ed8ff; }
.album-panel-empty { border-bottom-color: rgba(117, 184, 239, .16); color: rgba(177, 211, 239, .42); }
.page-control { color: #b9e1ff; }
.page-control:hover:not(:disabled) { color: #fff; text-shadow: 0 0 12px rgba(101, 190, 255, .65); }
.empty-state { background: rgba(5, 12, 22, .97); color: #eef7ff; }
.empty-record { border-color: #65baff; color: #a9dcff; }
.empty-state p, .empty-admin-hint { color: #b1cce4; }
.empty-admin-hint { color: #85c8fb; }

/* Controles del administrador y ventanas. */
.mini-admin-button,
.track-admin-actions button,
.plain-button {
  border-color: rgba(105, 184, 245, .43);
  color: #c5e5ff;
  background: rgba(25, 77, 121, .18);
}
.mini-admin-button:hover,
.track-admin-actions button:hover,
.plain-button:hover { color: #fff; background: rgba(54, 139, 206, .30); }
.track-admin-actions button { border: 0; background: transparent; }
.admin-toolbar { border-color: rgba(97, 176, 238, .36); background: rgba(40, 112, 173, .10); }
.admin-toolbar strong { color: #b9e1ff; }
.admin-toolbar small { color: #a8c5df; }
.gold-button {
  border-color: #83caff;
  color: #04101d;
  background: linear-gradient(135deg, #c6e8ff, #5ba9e8);
}
.keyboard-hint { color: #a9c7e2; }
kbd { border-color: rgba(113, 190, 250, .40); color: #c5e6ff; }
.hint-right { color: #8baecb; }
.player-shell { background: #02060b; }
.player-shell.is-docked { border-color: rgba(114, 195, 255, .85); }
.player-topbar { color: #eef8ff; }
.player-topbar button { border-color: rgba(192, 229, 255, .75); color: #fff; }
.cover-wrap.cover-is-playing { outline-color: rgba(118, 200, 255, .95); }

.modal {
  border-color: rgba(107, 190, 255, .65);
  color: #f3f8ff;
  background: #0a1524;
  box-shadow: 0 25px 90px rgba(0,0,0,.78), 0 0 35px rgba(24, 112, 188, .16);
}
.modal::backdrop { background: rgba(0, 4, 10, .84); }
.modal-x { color: #b9dcf8; }
.modal-description, .editor-intro { color: #afc8df; }
.field-label { color: #b9e1ff; }
.text-field {
  border-color: rgba(105, 184, 245, .42);
  color: #f3f8ff;
  background: rgba(255,255,255,.045);
}
.text-field:focus { border-color: #8bcfff; }
.text-field::placeholder { color: #9bb7d0; }
.form-error { color: #ff9da8; }
.file-field { color: #c1d9ee; }
.file-field::file-selector-button {
  border-color: rgba(105, 184, 245, .55);
  color: #d2ebff;
  background: rgba(30, 94, 145, .22);
}
.login-submit {
  border-color: #78c5ff;
  color: #d7efff;
  background: rgba(28, 94, 151, .18);
}
.login-submit:hover { color: #04101d; background: #b7e0ff; }
.toast {
  border-color: rgba(111, 190, 255, .60);
  color: #f1f8ff;
  background: #0c1b2d;
  box-shadow: 0 8px 25px rgba(0,0,0,.55), 0 0 20px rgba(28, 117, 194, .12);
}

@media (max-width: 850px) {
  .topbar {
    position: relative;
    display: flex;
    justify-content: center;
    min-height: 68px;
    padding: 10px 12px;
  }
  .search-box {
    width: min(520px, calc(100% - 145px));
    min-width: 160px;
    flex: 0 1 520px;
    margin: 0 auto;
  }
  .top-actions {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    margin: 0;
  }
}
@media (max-width: 560px) {
  .topbar { min-height: 62px; padding: 9px 8px; }
  .search-box { width: calc(100% - 112px); min-width: 0; height: 38px; }
  .top-actions { right: 8px; }
  .login-button { padding: 8px 10px; font-size: 9px; }
  .admin-add-button { width: 32px; height: 32px; }
  .main-content { padding-top: 10px; }
  .jukebox-frame { border-radius: 4px; }
  .page-right { border-top-color: rgba(112, 190, 255, .25); }
}

/* PRESENTACION A PANTALLA COMPLETA: solo buscador, acceso y cuatro albumes. */
:root {
  --rockola-topbar-height: 76px;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

@supports (height: 100dvh) {
  body { height: 100dvh; }
}

.topbar {
  flex: 0 0 var(--rockola-topbar-height);
  height: var(--rockola-topbar-height);
  min-height: var(--rockola-topbar-height);
  width: 100%;
  z-index: 10;
}

.main-content {
  flex: 1 1 auto;
  width: 100%;
  height: calc(100vh - var(--rockola-topbar-height));
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .main-content { height: calc(100dvh - var(--rockola-topbar-height)); }
}

.jukebox-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none !important;
  overflow: hidden;
}

.jukebox-frame::before { display: none !important; content: none !important; }
.frame-topline { display: none !important; }

.book-wrap {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
}

.book {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.book-page {
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: clamp(8px, 1.5vh, 20px) clamp(12px, 1.7vw, 28px);
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
}

.page-left,
.page-right {
  border: 0 !important;
  box-shadow: none !important;
}

.book-spine { display: none !important; }

.page-albums {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: 100%;
  min-height: 0;
  gap: clamp(8px, 1.3vh, 18px);
}

.album-panel {
  grid-template-columns: minmax(112px, min(37%, 270px)) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(12px, 1.5vw, 25px);
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: clamp(8px, 1.3vh, 18px) clamp(7px, 1vw, 16px);
  border-bottom: 1px solid rgba(117, 184, 239, .20);
  overflow: hidden;
}

.cover-column {
  min-width: 0;
  justify-content: center;
}

.cover-wrap {
  width: min(100%, clamp(112px, 22vh, 260px));
  max-width: 100%;
  margin: auto;
}

.album-info {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.album-artist,
.album-title,
.album-year { flex: 0 0 auto; }

.album-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.track-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow-x: hidden;
  overflow-y: auto;
}

.track-row { min-height: 24px; font-size: clamp(8px, .72vw, 11px); }
.album-panel-empty { min-height: 0; height: 100%; border: 0; }
.frame-bottomline { display: none !important; }

/* En vertical, los cuatro albumes pasan a una sola columna ordenada. */
@media (max-width: 700px) and (orientation: portrait) {
  :root { --rockola-topbar-height: 68px; }

  .topbar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 9px 10px;
  }

  .search-box {
    flex: 0 1 520px;
    width: calc(100% - 112px);
    min-width: 0;
    margin: 0 auto;
  }

  .top-actions {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
  }

  .main-content { height: calc(100vh - var(--rockola-topbar-height)); }
  @supports (height: 100dvh) {
    .main-content { height: calc(100dvh - var(--rockola-topbar-height)); }
  }

  .book {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(4, minmax(0, 1fr));
    perspective: none;
  }

  .book-page,
  .page-albums { display: contents; }

  .book-spine { display: none !important; }

  .page-left .page-albums > :nth-child(1) { order: 1; }
  .page-right .page-albums > :nth-child(1) { order: 2; }
  .page-left .page-albums > :nth-child(2) { order: 3; }
  .page-right .page-albums > :nth-child(2) { order: 4; }

  .album-panel {
    grid-template-columns: clamp(78px, 26vw, 142px) minmax(0, 1fr);
    gap: clamp(8px, 2vw, 14px);
    padding: 5px clamp(9px, 3vw, 16px);
    border-bottom: 1px solid rgba(117, 184, 239, .20);
  }

  .cover-wrap { width: min(100%, clamp(76px, 25vw, 136px)); }
  .album-artist { margin: 0 0 2px; font-size: clamp(7px, 2vw, 9px); }
  .album-title { margin: 0; font-size: clamp(12px, 3.7vw, 16px); }
  .album-year { margin: 2px 0 4px; font-size: 7px; }
  .track-list { gap: 0; }
  .track-row { min-height: 18px; padding: 2px 3px; font-size: clamp(7px, 2vw, 9px); }
  .track-number { font-size: 7px; }
  .admin-card-actions { gap: 3px; padding-top: 3px; }
  .mini-admin-button { min-width: 18px; min-height: 17px; padding: 0 4px; }
}

@media (max-width: 560px) and (orientation: portrait) {
  :root { --rockola-topbar-height: 62px; }
  .topbar { padding: 8px; }
  .search-box { width: calc(100% - 108px); height: 38px; }
  .top-actions { right: 8px; }
  .login-button { padding: 8px 10px; font-size: 9px; }
  .main-content { height: calc(100vh - var(--rockola-topbar-height)); }
  @supports (height: 100dvh) {
    .main-content { height: calc(100dvh - var(--rockola-topbar-height)); }
  }
}

/* En horizontal, incluso en tablet/celular, se conserva la doble página. */
@media (max-width: 850px) and (orientation: landscape) {
  :root { --rockola-topbar-height: 58px; }
  .topbar { min-height: 58px; height: 58px; flex-basis: 58px; padding-top: 7px; padding-bottom: 7px; }
  .main-content { height: calc(100vh - 58px); }
  @supports (height: 100dvh) {
    .main-content { height: calc(100dvh - 58px); }
  }
  .book { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .book-page { display: block; }
  .page-albums { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .album-panel { grid-template-columns: minmax(82px, 30%) minmax(0, 1fr); gap: 8px; padding: 4px; }
  .cover-wrap { width: min(100%, 17vh); }
  .track-row { min-height: 17px; font-size: 7px; }
}


/* Portadas: aprovechar la altura disponible sin deformar ni recortar la imagen. */
@media (min-width: 701px) {
  .album-panel {
    grid-template-columns: minmax(112px, min(42vh, 48%)) minmax(0, 1fr);
  }
}

.cover-column {
  height: 100%;
  min-height: 0;
  min-width: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cover-wrap {
  width: fit-content;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
}

.cover-wrap img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
}

.cover-wrap:hover img {
  transform: none;
}

/* En celular, se amplía la columna de la tapa tanto como permite la pantalla. */
@media (max-width: 700px) and (orientation: portrait) {
  .album-panel {
    grid-template-columns: minmax(78px, min(42%, 22vh)) minmax(0, 1fr);
  }
}

@media (max-width: 850px) and (orientation: landscape) {
  .album-panel {
    grid-template-columns: minmax(82px, min(38%, 36vh)) minmax(0, 1fr);
  }
}


/* Correccion definitiva: ocultar el triangulo indicador del album seleccionado.
   Se conserva el resaltado azul del marco. */
.album-panel.is-selected::before {
  content: none !important;
  display: none !important;
}
