﻿/* General Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #174b72;
  background-image: url("images/background.jpg");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Header Styles */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  color: #2c3e50;
  padding: 15px;
  width: 100%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid #3498db;
}

.header img.bares-logo {
  height: 60px;
  margin-right: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #2c3e50;
}

/* Button Container */
.container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 600px;
  padding: 20px;
}

/* Selection Controls */
.selection-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: min(calc(100% - 24px), 600px);
}

.swipe-viewport { width: 100%; overflow: hidden; touch-action: pan-y; }
.swipe-track { display: flex; width: 600%; transition: transform 320ms ease, height 220ms ease; align-items: flex-start; }
.swipe-track.show-second { transform: translateX(-16.666667%); }
.swipe-track.show-third { transform: translateX(-33.333333%); }
.swipe-track.show-fourth { transform: translateX(-50%); }
.swipe-track.show-fifth { transform: translateX(-66.666667%); }
.swipe-track.show-sixth { transform: translateX(-83.333333%); }
.player-page {
  width: 16.666667%;
  flex: 0 0 16.666667%;
  min-height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.player-page:nth-child(6) {
  background-image: linear-gradient(rgba(10,39,61,.12),rgba(10,39,61,.12)),url("images/background.jpg");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}
.page-title {
  margin: 18px 12px 8px;
  padding: 8px 16px;
  border-radius: 10px;
  color: #fff;
  background: rgba(16, 43, 64, 0.78);
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.page-title { display: none; }
.app-notification[hidden] { display: none; }
.app-notification {
  position: fixed; z-index: 1200; top: 50%; left: 50%;
  width: min(88vw,520px); padding: 18px 22px;
  transform: translate(-50%,-50%) scale(.94); opacity: 0;
  border: 1px solid rgba(255,255,255,.42); border-radius: 20px;
  color: #fff; background: rgba(12,42,65,.62);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 55px rgba(0,0,0,.34); text-align: center;
  font-size: clamp(24px,7vw,42px); font-weight: 800; line-height: 1.15;
  text-shadow: 0 2px 5px rgba(0,0,0,.58); pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.app-notification.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.swipe-hint {
  margin: 0 12px 12px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #fff;
  background: rgba(16, 43, 64, 0.78);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.page-tabs {
  position: relative;
  z-index: 5;
  display: flex;
  gap: 10px;
  margin: 10px 0;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 3px 14px rgba(0,0,0,.3);
}
.page-dot {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #174b72;
  border-radius: 50%;
  background: #d9e7f2;
  box-shadow: inset 0 0 0 2px #fff;
  cursor: pointer;
}
.page-dot.active {
  width: 34px;
  border-radius: 999px;
  background: #1675c1;
}
.selection-action-buttons { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.selection-action-buttons button { flex: 0 0 auto; white-space: nowrap; }
.save-state-btn { min-height: 40px; padding: 0 16px; border: 0; border-radius: 25px; color: #fff; background: #238b57; font-weight: 700; cursor: pointer; }
.save-state-btn:hover { background: #1b7046; }
#save-state-status { display: block; min-height: 16px; margin-top: 3px; color: #238b57; font-size: 12px; font-weight: 700; }
.inline-save-status { display: block; min-height: 16px; margin-top: 3px; color: #238b57; font-size: 12px; font-weight: 700; }
.default-editor-card { flex-wrap: wrap; gap: 9px; }
.default-editor-card .custom-fields { width: 100%; }
.default-editor-actions { width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.default-editor-actions button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; font-weight: 700; cursor: pointer; }
.default-save-btn { color: #17633f; background: #e4f6ec; }
.default-save-btn:hover, .default-save-btn:focus-visible { background: #d4eedf; }
.default-remove-btn { color: #9f2722; background: #fdecea; }
.default-restore-btn { color: #174b72; background: #eaf3fa; }
.default-lyrics { width: 100%; min-height: 130px; resize: vertical; border: 1px solid #cbd9e4; border-radius: 9px; padding: 10px; font: inherit; }
.optional-lyrics { width: 100%; overflow: hidden; border: 1px solid #cbd9e4; border-radius: 9px; background: rgba(255,255,255,.7); }
.optional-lyrics summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 8px 11px; color: #27485e; font-weight: 700; cursor: pointer; list-style: none; }
.optional-lyrics summary::-webkit-details-marker { display: none; }
.optional-lyrics summary::after { content: '▾'; transition: transform 160ms ease; }
.optional-lyrics[open] summary::after { transform: rotate(180deg); }
.optional-lyrics .default-lyrics { display: block; border-width: 1px 0 0; border-radius: 0; }
.icon-action-btn { width: 44px; min-width: 44px; height: 44px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.icon-action-btn .control-icon { width: 25px; height: 25px; }
.mute { min-width: 40px; min-height: 40px; border: 0; border-radius: 10px; color: #174b72; background: #eaf3fa; font-weight: 800; cursor: pointer; }
.mute.active { color: #fff; background: #c0392b; }
.march-track { flex-wrap: wrap; }
.march-track .controls { margin-left: auto; }
.marches-container { width: 100%; max-width: 600px; }
.lyrics-button { min-width: 40px; min-height: 40px; padding: 0 9px; border: 0; border-radius: 10px; color: #174b72; background: #eaf3fa; font-weight: 700; cursor: pointer; }
.lyrics-button:disabled { opacity: .38; cursor: not-allowed; }
.lyrics-overlay[hidden] { display: none; }
.lyrics-overlay { position: fixed; z-index: 1000; top: 0; left: 0; width: 100%; height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; background: rgba(4,18,31,.46); }
.lyrics-dialog { position: relative; left: 0; display: flex; flex-direction: column; width: calc(100% - 32px); max-width: 720px; height: min(78dvh,760px); margin: 0 auto; overflow: hidden; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 22px; background: rgba(13,36,55,.54); backdrop-filter: blur(20px) saturate(135%); -webkit-backdrop-filter: blur(20px) saturate(135%); box-shadow: 0 24px 70px rgba(0,0,0,.48); }
.lyrics-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px 9px; }
.lyrics-dialog-header h2 { margin: 0; font-size: clamp(20px,4vw,28px); }
.lyrics-close { width: 42px; height: 42px; padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); font-size: 30px; line-height: 1; cursor: pointer; }
.lyrics-toolbar { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 8px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.08); }
.lyrics-toolbar label { flex: 1 1 250px; display: grid; grid-template-columns: auto 1fr 48px; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; }
.lyrics-toolbar input { width: 100%; accent-color: #61d5ff; }
.lyrics-toolbar output { text-align: right; font-variant-numeric: tabular-nums; }
.lyrics-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 30vh clamp(20px,6vw,64px); text-align: center; scrollbar-color: rgba(255,255,255,.5) transparent; }
.lyrics-text { font-size: 24px; line-height: 1.75; white-space: pre-line; text-wrap: balance; text-shadow: 0 2px 5px rgba(0,0,0,.75); }
body.lyrics-open { overflow: hidden; }
.managed-youtube-overlay[hidden] { display: none; }
.managed-youtube-overlay { position: fixed; z-index: 1050; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(4,18,31,.62); }
.managed-youtube-dialog { position: relative; width: min(760px,96vw); padding: 50px 12px 12px; border-radius: 18px; background: #111; box-shadow: 0 22px 65px rgba(0,0,0,.55); }
.managed-youtube-dialog iframe { display: block; width: 100%; aspect-ratio: 16 / 9; min-height: 0; border: 0; }
.managed-youtube-close { position: absolute; top: 9px; right: 10px; width: 40px; height: 40px; border: 1px solid #777; border-radius: 50%; color: #fff; background: #333; font-size: 28px; cursor: pointer; }
.youtube-fallback { padding: 10px; color: #fff; text-align: center; }
.youtube-fallback[hidden] { display: none; }
.youtube-fallback p { margin: 0 0 10px; font-size: 13px; line-height: 1.4; }
.youtube-fallback a { display: inline-block; padding: 9px 13px; border-radius: 8px; color: #fff; background: #c62828; font-weight: 700; text-decoration: none; }
.accordion-item { width: 100%; overflow: hidden; border-radius: 13px; background: rgba(255,255,255,.95); box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.accordion-trigger { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border: 0; color: #243746; background: transparent; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.accordion-trigger::after { content: '+'; flex: 0 0 auto; font-size: 26px; line-height: 1; color: #1675c1; transition: transform 180ms ease; }
.accordion-trigger[aria-expanded="true"]::after { transform: rotate(45deg); }
.accordion-panel { padding: 4px 18px 18px; border-top: 1px solid rgba(44,62,80,.14); color: #34495e; line-height: 1.6; white-space: pre-line; }
.accordion-panel[hidden] { display: none; }
.accordion-panel a { color: #0969a9; overflow-wrap: anywhere; }
.accordion-panel h3 { margin: 14px 0 3px; color: #174b72; }
.accordion-panel .credit-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid rgba(44,62,80,.1); }
.accordion-panel .credit-role { color: #526b7c; text-align: right; }
.copyright-credit-note { padding: 10px 12px; border-left: 4px solid #1675c1; border-radius: 7px; background: #edf6fb; }
.version-history { margin: 6px 0 16px; padding: 11px 12px; border-radius: 8px; background: #edf6fb; }
.coffee-donation-card { width: 100%; padding: 22px; overflow: hidden; border: 1px solid rgba(255,255,255,.65); border-radius: 18px; color: #3d2b22; background: linear-gradient(145deg,rgba(255,253,247,.98),rgba(241,224,196,.97)); box-shadow: 0 10px 30px rgba(23,45,58,.24); }
.coffee-donation-icon { float: right; margin: -7px -2px 4px 15px; font-size: 58px; filter: drop-shadow(0 5px 5px rgba(69,43,25,.18)); }
.coffee-donation-kicker { margin: 0 0 3px; color: #7b4e2d; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.coffee-donation-copy h2 { margin: 0; color: #4d2f20; font-size: clamp(23px,5vw,30px); }
.coffee-donation-copy > p:last-child { max-width: 470px; margin: 8px 0 17px; color: #674d3c; line-height: 1.5; }
.coffee-options { clear: both; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.coffee-option { min-height: 68px; display: grid; grid-template-columns: 54px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border: 1px solid #d4b995; border-radius: 12px; color: #543825; background: rgba(255,255,255,.72); font: inherit; text-align: left; cursor: pointer; transition: transform 140ms ease,background 140ms ease,border-color 140ms ease; }
.coffee-option:last-child { grid-column: 1 / -1; }
.coffee-option:hover { transform: translateY(-1px); border-color: #8b5e3c; }
.coffee-option.selected { border-color: #08734f; color: #fff; background: #08734f; box-shadow: 0 5px 14px rgba(8,115,79,.22); }
.coffee-option img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(58,35,20,.22)); }
.coffee-option span { font-size: 13px; font-weight: 650; }
.coffee-option strong { font-size: 17px; white-space: nowrap; }
.payment-heading { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 8px; color: #674d3c; font-size: 13px; font-weight: 700; }
.selected-donation-amount { color: #08734f; font-size: 22px; }
.payment-method-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.payment-method-tab { min-height: 42px; border: 1px solid #b9c9d7; border-radius: 9px; color: #31536c; background: rgba(255,255,255,.76); font-weight: 800; cursor: pointer; }
.payment-method-tab.selected { border-color: #075baa; color: #fff; background: #075baa; }
.donation-payment-card { margin-top: 9px; padding: 13px; border-radius: 13px; background: #fff; text-align: center; box-shadow: inset 0 0 0 1px rgba(53,73,87,.11); }
.donation-payment-card img { display: block; width: min(100%,390px); max-height: 480px; margin: 0 auto; object-fit: contain; border-radius: 9px; }
.donation-payment-card p { margin: 10px 0 0; color: #526b7c; font-size: 12px; }
.donation-qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.donation-qr-actions a { min-height: 43px; display: flex; align-items: center; justify-content: center; padding: 8px 10px; border-radius: 9px; color: #fff; background: #075baa; font-size: 13px; font-weight: 800; text-decoration: none; }
.donation-qr-actions .open-donation-qr { color: #075baa; background: #e8f2fb; }
.donation-payment-guide { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #edf6fb; text-align: left; }
.donation-payment-guide p:first-child { margin-top: 0; }
.donation-return-note { margin: 11px 2px 0; color: #674d3c; font-size: 12px; line-height: 1.5; text-align: center; }
.coffee-price-note { margin: 10px 2px 0; color: #796452; font-size: 11px; line-height: 1.4; }
.donation-reminder-overlay[hidden] { display: none; }
.donation-reminder-overlay { position: fixed; z-index: 1300; inset: 0; display: grid; place-items: center; padding: 14px; background: rgba(4,18,31,.72); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.donation-reminder-dialog { width: min(620px,100%); max-height: calc(100dvh - 28px); overflow-y: auto; padding: 19px; border: 1px solid rgba(255,255,255,.35); border-radius: 22px; color: #fff; background: rgba(13,36,55,.94); box-shadow: 0 26px 80px rgba(0,0,0,.5); }
.donation-reminder-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.donation-reminder-header p { margin: 0 0 3px; color: #aee5ff; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.donation-reminder-header h2 { margin: 0; font-size: clamp(23px,5vw,31px); }
.donation-reminder-close { width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); font-size: 30px; line-height: 1; cursor: pointer; }
.donation-reminder-close[hidden] { display: none; }
.donation-reminder-message { margin: 9px 0 15px; color: #dceaf3; line-height: 1.5; }
.donation-reminder-content .coffee-donation-card { box-shadow: none; }
.donation-reminder-content .coffee-donation-kicker,.donation-reminder-content .coffee-donation-copy { display: none; }
.donation-reminder-content .coffee-donation-icon { display: none; }
.donation-reminder-actions { display: grid; gap: 8px; margin-top: 14px; }
.donation-submitted-btn { min-height: 48px; padding: 10px 16px; border: 0; border-radius: 11px; color: #fff; background: #168356; font-weight: 800; cursor: pointer; }
.donation-submitted-btn:disabled { opacity: .68; cursor: wait; }
#donation-reminder-status { min-height: 18px; color: #cde9f8; font-size: 12px; text-align: center; }
.donation-close-countdown { margin: 10px 0 0; color: #b9c9d4; font-size: 12px; text-align: center; }
body.donation-reminder-open { overflow: hidden; }
.copyright-entry { margin-top: 16px; padding: 4px 13px 12px; border: 1px solid #c9dce8; border-radius: 10px; background: #f7fbfd; }
.copyright-entry p { margin: 7px 0; white-space: normal; }
.copyright-accordion { margin-top: 10px; overflow: hidden; border: 1px solid #c9dce8; border-radius: 10px; background: #f7fbfd; }
.copyright-accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 13px; color: #174b72; font-weight: 700; cursor: pointer; list-style: none; }
.copyright-accordion summary::-webkit-details-marker { display: none; }
.copyright-accordion summary::after { content: '+'; font-size: 22px; line-height: 1; }
.copyright-accordion[open] summary::after { transform: rotate(45deg); }
.copyright-accordion-content { padding: 2px 13px 12px; border-top: 1px solid #d7e5ed; }
.copyright-accordion-content p { margin: 7px 0; white-space: normal; }

@media (max-width: 520px) {
  .accordion-panel .credit-row { display: block; }
  .accordion-panel .credit-role { display: block; text-align: left; font-size: 13px; }
  .coffee-donation-card { padding: 17px 14px; }
  .coffee-options { grid-template-columns: 1fr; }
  .coffee-option:last-child { grid-column: auto; }
  .payment-method-tab { padding: 7px 4px; font-size: 12px; }
  .donation-reminder-overlay { padding: 6px; }
  .donation-reminder-dialog { max-height: calc(100dvh - 12px); padding: 14px 10px; border-radius: 16px; }
  .donation-reminder-content .coffee-donation-card { padding: 13px 10px; }
}

.custom-track { flex-wrap: wrap; gap: 10px; }
.custom-fields { width: 100%; display: grid; gap: 9px; }
.custom-title, .custom-url, .custom-file-label {
  width: 100%; min-height: 42px; border: 1px solid #cbd9e4; border-radius: 9px;
  padding: 9px 11px; background: rgba(255,255,255,.86); color: #243746; font: inherit;
}
.custom-source-options { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #445b6b; }
.custom-source-options label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.custom-file-label { display: flex; align-items: center; cursor: pointer; overflow: hidden; }
.custom-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.custom-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-url[hidden], .custom-file-label[hidden] { display: none; }
.custom-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.remove-track-btn, .add-track-btn { border: 0; border-radius: 10px; cursor: pointer; font-weight: 600; }
.remove-track-btn { width: 44px; min-width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: #a93226; background: #fdecea; }
.add-track-btn { margin: 4px 12px 28px; padding: 13px 22px; color: white; background: #1675c1; }
.custom-audio-tools { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding-top: 10px; border-top: 1px solid rgba(44,62,80,.14); }
.audio-tool-btn { min-width: 0; min-height: 38px; border: 1px solid #b8cede; border-radius: 9px; background: #edf5fa; color: #27485e; font-weight: 600; cursor: pointer; }
.audio-tool-btn .control-icon { width: 24px; height: 24px; }
.audio-tool-btn.active { color: #fff; background: #1675c1; border-color: #1675c1; }
.audio-tool-btn.control-disabled,
.audio-tool-btn:disabled {
  color: #77828a;
  background: #d5d9dc;
  border-color: #c2c7cb;
  opacity: .68;
  cursor: not-allowed;
  box-shadow: none;
}
.audio-tool-panel { grid-column: 1 / -1; width: 100%; min-width: 0; padding: 10px 12px; border-radius: 9px; background: rgba(231,242,249,.9); }
.audio-tool-panel[hidden] { display: none; }
.audio-tool-panel label { display: flex; align-items: center; justify-content: center; gap: 9px; color: #27485e; font-size: 13px; font-weight: 600; }
.audio-tool-panel input[type="range"] { flex: 1; accent-color: #1675c1; }
.audio-tool-panel .pan-control {
  --pan-fill-start: 50%;
  --pan-fill-end: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}
.audio-tool-panel .pan-control::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(to right,
    #aebdca 0 var(--pan-fill-start),
    #1675c1 var(--pan-fill-start) var(--pan-fill-end),
    #aebdca var(--pan-fill-end) 100%);
}
.audio-tool-panel .pan-control::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  margin-top: -7.5px;
  background: #64717c;
  box-shadow: 0 1px 4px rgba(35,55,70,.4);
}
.audio-tool-panel .pan-control::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #64717c;
  box-shadow: 0 1px 4px rgba(35,55,70,.4);
}
.audio-tool-panel .pan-control::-moz-range-track {
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(to right,
    #aebdca 0 var(--pan-fill-start),
    #1675c1 var(--pan-fill-start) var(--pan-fill-end),
    #aebdca var(--pan-fill-end) 100%);
}
.audio-tool-panel .pan-control::-moz-range-progress { height: 5px; background: transparent; }
.audio-tool-panel select { min-height: 36px; flex: 1; border: 1px solid #b8cede; border-radius: 7px; padding: 5px 8px; background: white; }
.volume-panel output { min-width: 42px; text-align: right; }
.youtube-player-wrap { width: 100%; margin: 4px auto 0; overflow: hidden; border-radius: 10px; background: #111; }
.youtube-player-wrap[hidden] { display: none; }
.youtube-player-wrap iframe { display: block; width: 100%; aspect-ratio: 16 / 9; min-height: 0; border: 0; }
.youtube-player-wrap iframe[hidden] { display: none; }
.youtube-player-wrap p { margin: 0; padding: 8px 10px; color: #fff; background: #263844; font-size: 11px; line-height: 1.4; }
.youtube-player-wrap .youtube-fallback { padding: 10px; }
.audio-tool-panel.control-unavailable { opacity: .45; pointer-events: none; }

.select-all-btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-all-btn:hover {
  background: #2c80b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.select-all-btn:active {
  transform: translateY(0);
}

.selection-info {
  font-size: 14px;
  color: #7f8c8d;
  font-weight: 500;
}

/* Button Styles */
.button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: none;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  margin-top: 15px;
}

/* Footer Styles */
.footer {
  margin-top: auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  color: #2c3e50;
  width: 100%;
  text-align: center;
  border-top: 3px solid #3498db;
}

.footer a {
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* Mobile Optimizations */
* {
  box-sizing: border-box;
  tap-highlight-color: transparent;
}

body {
  overflow-x: hidden;
}


/* Larger touch targets for mobile */
  .button {
    min-height: 60px !important;
    padding: 12px !important;
  }

  .controls button {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

@media (-webkit-touch-callout: none) {
  body {
    overflow-x: hidden;
    min-height: 100vh;
  }
}

/* Responsive font sizes */
.header h1 {
  font-size: clamp(24px, 6vw, 28px);
}

.container {
  padding: 0 max(12px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.footer {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Prevent text selection during interaction */
.button, .controls button, .shuffle-btn, .shuffle-play-btn, .track-select, .select-all-btn {
  user-select: none;
  -webkit-user-select: none;
}

/* Loading states */
.button.loading {
  opacity: 0.7;
  pointer-events: none;
}

.button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
















/* Fix button icon size */
.control-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.button.playing { outline: 3px solid #27ae60; }
.container > .button.playing {
  color: #fff;
  background-image: linear-gradient(30deg, #0400ff, #4ce3f7);
  background-size: 100% auto;
  border-radius: 20px;
  outline: none;
  animation: track-pulse 1.5s infinite;
}

.container > .button.playing .button-content,
.container > .button.playing .track-select {
  color: #fff;
}

.container > .button.playing .sound-wave span {
  background: rgba(255, 255, 255, 0.78);
}

.container > .button.paused {
  color: #4d5961;
  background: linear-gradient(135deg, rgba(224, 228, 231, 0.98), rgba(175, 183, 190, 0.98));
  outline: 3px solid #8a949b;
  box-shadow: 0 6px 20px rgba(49, 60, 68, 0.2);
}

.container > .button.paused .button-content,
.container > .button.paused .track-select {
  color: #4d5961;
}

.container > .button.paused .sound-wave {
  opacity: 0.28;
}

.container > .button.paused .sound-wave span {
  animation: none;
  background: #65727b;
}

@keyframes track-pulse {
  0% { box-shadow: 0 0 0 0 rgba(5, 186, 218, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(5, 186, 218, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 186, 218, 0); }
}
.sound-wave-set {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 76px;
  height: 32px;
  margin-left: auto;
  pointer-events: none;
  flex: 0 0 76px;
}

.sound-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 24px;
  height: 32px;
  opacity: 0;
  transform: scaleX(0.75);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  flex: 0 0 24px;
}

.sound-wave span {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: rgba(39, 174, 96, 0.58);
  transform-origin: center;
}

.button.playing .sound-wave {
  opacity: 0.72;
  transform: scaleX(1);
}

.button.playing .sound-wave span {
  animation: sound-wave 780ms ease-in-out infinite alternate;
}

.button.playing .sound-wave span:nth-child(2) { animation-delay: -520ms; }
.button.playing .sound-wave span:nth-child(3) { animation-delay: -260ms; }
.button.playing .sound-wave span:nth-child(4) { animation-delay: -650ms; }
.button.playing .sound-wave span:nth-child(5) { animation-delay: -390ms; }

@keyframes sound-wave {
  0% { transform: scaleY(0.55); opacity: 0.45; }
  50% { transform: scaleY(2.6); opacity: 0.85; }
  100% { transform: scaleY(1.15); opacity: 0.62; }
}

/* Full-card visualizer used only by the players on swipes 2, 3, and 5. */
.instrumental-track .track-visualizer,
.custom-track .track-visualizer,
.march-track .track-visualizer {
  position: absolute;
  z-index: 0;
  inset: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: stretch;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.instrumental-track.playing .track-visualizer,
.custom-track.playing .track-visualizer,
.march-track.playing .track-visualizer { opacity: .62; }
.instrumental-track .button-content,
.instrumental-track .controls,
.custom-track .custom-fields,
.custom-track .custom-actions,
.custom-track .youtube-player-wrap,
.custom-track .custom-audio-tools,
.march-track .button-content,
.march-track .controls { position: relative; z-index: 1; }
.instrumental-track .track-select span,
.instrumental-track.playing .track-select span,
.instrumental-track.paused .track-select span,
.march-track .track-select span,
.march-track.playing .track-select span,
.march-track.paused .track-select span,
.custom-track .custom-title {
  color: #111;
  font-weight: 800;
}
.player-page[aria-label="Original tracks"] .track-select span { font-weight: 800; }
.track-visualizer .bar {
  flex: 1 1 0;
  min-width: 1px;
  max-width: 3px;
  height: 24%;
  margin: 0 .75px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 3px rgba(22,117,193,.85);
  animation: track-wave-lg var(--wave-duration) ease-in-out var(--wave-delay) infinite alternate;
  animation-play-state: paused;
}
.instrumental-track.playing .track-visualizer .bar,
.custom-track.playing .track-visualizer .bar,
.march-track.playing .track-visualizer .bar { animation-play-state: running; }
.track-visualizer .bar:nth-child(-n + 7),
.track-visualizer .bar:nth-last-child(-n + 7) { animation-name: track-wave-md; }
.track-visualizer .bar:nth-child(-n + 3),
.track-visualizer .bar:nth-last-child(-n + 3) { animation-name: track-wave-sm; }
@keyframes track-wave-sm {
  from { opacity: .35; height: 10%; }
  to { opacity: 1; height: 28%; }
}
@keyframes track-wave-md {
  from { opacity: .35; height: 16%; }
  to { opacity: 1; height: 54%; }
}
@keyframes track-wave-lg {
  from { opacity: .35; height: 18%; }
  to { opacity: 1; height: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  .button.playing .sound-wave span {
    animation: none;
  }

  .button.playing .sound-wave span:nth-child(odd) {
    transform: scaleY(1.8);
  }

  .track-visualizer .bar { animation: none; height: 34%; }
}

.track-select { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.button-content { flex: 1 1 auto; min-width: 0; }
.track-select input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: #1675c1;
}
.track-select span { min-width: 0; }
.controls button { border: 0; border-radius: 10px; background: #eaf3fa; cursor: pointer; }
.controls button:hover, .controls button:focus-visible { outline: 2px solid #1675c1; }
@media (max-width: 520px) {
  .selection-controls { flex-wrap: wrap; gap: 10px; }
  .selection-action-buttons .select-all-btn,
  .selection-action-buttons .save-state-btn { padding-left: 12px; padding-right: 12px; }
  .selection-info { width: 100%; text-align: left; font-size: 12px; }
}

button.play, button.stop, button.repeat {
  width: 40px;
  height: 40px;
  padding: 0;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.registration-gate[hidden] { display: none; }
.registration-gate { position: fixed; z-index: 3000; inset: 0; display: grid; place-items: center; padding: 14px; overflow-y: auto; background: rgba(7,27,43,.76); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.registration-card { width: min(100%,480px); margin: auto; padding: 22px; border: 1px solid rgba(255,255,255,.58); border-radius: 20px; color: #243746; background: rgba(255,255,255,.96); box-shadow: 0 24px 75px rgba(0,0,0,.42); }
.registration-logo { display: block; width: min(190px,58%); height: auto; margin: 0 auto 10px; }
.registration-card h2 { margin: 0 0 8px; color: #174b72; text-align: center; }
.registration-intro { margin: 0 0 17px; color: #526b7c; font-size: 14px; line-height: 1.45; text-align: center; }
.registration-card > label:not(.registration-consent) { display: grid; gap: 5px; margin-top: 11px; font-size: 13px; font-weight: 700; }
.registration-card input[type="text"] { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #aec5d5; border-radius: 9px; background: #fff; color: #243746; font: inherit; font-size: 16px; }
.registration-card input:focus-visible { outline: 3px solid rgba(22,117,193,.24); border-color: #1675c1; }
.registration-consent { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; color: #445b6b; font-size: 12px; line-height: 1.4; cursor: pointer; }
.registration-consent input { flex: 0 0 21px; width: 21px; height: 21px; margin: 1px 0 0; accent-color: #1675c1; }
.registration-status { min-height: 34px; margin: 12px 0 5px; font-size: 13px; font-weight: 700; text-align: center; }
.registration-status.error { color: #b3261e; }
.registration-status.success { color: #197443; }
.registration-submit { width: 100%; min-height: 48px; border: 0; border-radius: 11px; color: #fff; background: #1675c1; font: inherit; font-weight: 800; cursor: pointer; }
.registration-submit:disabled { opacity: .65; cursor: wait; }
body.registration-required { overflow: hidden; }

.default-editor-card .custom-title { font-weight: 800; }
.optional-lyrics summary { font-weight: 500; }
.audio-tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; }

/* Compact, consistent controls for phone-sized APK/WebView screens. */
@media (max-width: 600px) {
  .header { min-height: 72px; padding: 9px 12px; }
  .header img.bares-logo { width: auto; height: clamp(44px,13vw,54px); margin-right: 10px; border-radius: 8px; }
  .header h1 { font-size: clamp(20px,6vw,25px); }

  .page-tabs { gap: 7px; margin: 8px 0; padding: 7px 10px; }
  .page-dot { width: 16px; height: 16px; min-width: 16px; min-height: 16px; }
  .page-dot.active { width: 30px; min-width: 30px; }
  .swipe-hint { max-width: calc(100% - 24px); font-size: 12px; line-height: 1.4; }

  .container { gap: 10px; padding-right: 8px; padding-left: 8px; }
  .selection-controls { width: calc(100% - 16px); margin-bottom: 8px; padding: 10px; border-radius: 10px; }
  .selection-action-buttons { width: 100%; gap: 7px; }
  .selection-action-buttons > button { flex: 1 1 0; min-width: 0; min-height: 44px; justify-content: center; padding: 7px 9px; font-size: 12px; }

  .button { width: 100%; min-height: 58px !important; margin-top: 0; padding: 9px !important; border-radius: 11px; gap: 6px; }
  .button-content { flex: 1 1 120px; }
  .track-select { gap: 8px; font-size: 14px; line-height: 1.25; }
  .track-select input[type="checkbox"] { flex-basis: 22px; width: 22px; min-width: 22px; height: 22px; min-height: 22px; }
  .control-icon { width: 22px; height: 22px; }
  .controls { flex: 0 0 auto; gap: 5px; margin-left: auto; }
  .controls button, button.play, button.stop, button.repeat, .mute, .lyrics-button {
    width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0;
  }
  .instrumental-track { flex-wrap: wrap; }
  .instrumental-track .button-content { flex: 1 1 calc(100% - 10px); }
  .instrumental-track .controls { width: 100%; justify-content: flex-end; margin-top: 2px; }
  .instrumental-track .lyrics-button { width: 44px; min-width: 44px; padding: 0; }
  .sound-wave-set { display: flex; width: 64px; height: 28px; flex: 0 0 64px; }
  .sound-wave { display: flex; width: 20px; height: 28px; flex: 0 0 20px; gap: 1px; }
  .sound-wave span { width: 3px; }
  .instrumental-track .sound-wave-set,
  .march-track .sound-wave-set { position: absolute; top: 14px; right: 12px; }
  .instrumental-track .button-content,
  .march-track .button-content { padding-right: 46px; }

  .march-track .button-content { flex: 1 1 calc(100% - 10px); }
  .march-track .controls { width: 100%; justify-content: flex-end; margin-top: 2px; }
  .marches-container { width: 100%; padding-right: 8px; padding-left: 8px; }
  .custom-actions { width: 100%; justify-content: flex-end; }
  .custom-actions button { min-height: 44px; }
  .custom-title, .custom-url, .custom-file-label, .default-lyrics, .audio-tool-panel select { font-size: 16px; }
  .custom-source-options { gap: 10px 14px; }
  .custom-source-options label { min-height: 36px; }
  .custom-source-options input { width: 18px; height: 18px; }
  .audio-tool-btn { min-width: 0; min-height: 44px; padding: 5px; font-size: 12px; }
  .audio-tool-panel { padding: 9px; }
  .audio-tool-panel label { flex-wrap: wrap; }
  .audio-tool-panel input[type="range"] { min-width: 150px; min-height: 34px; touch-action: pan-x; }

  .default-editor-actions { display: flex; justify-content: flex-end; gap: 5px; }
  .default-editor-actions button { flex: 0 0 44px; min-height: 44px; padding: 0; }
  .accordion-trigger { min-height: 52px; padding: 11px 13px; font-size: 14px; }
  .accordion-panel { padding: 4px 13px 14px; font-size: 14px; }
  .copyright-accordion summary { min-height: 48px; padding: 10px; }

  .lyrics-overlay { padding: 8px; }
  .lyrics-dialog { width: 100%; height: min(86dvh,760px); border-radius: 16px; }
  .lyrics-dialog-header { padding: 10px 12px 7px; }
  .lyrics-close { width: 44px; height: 44px; flex: 0 0 44px; }
  .lyrics-toolbar { gap: 8px; padding: 7px 12px 10px; }
  .lyrics-toolbar label { flex-basis: 100%; grid-template-columns: 76px minmax(0,1fr) 42px; }
  .lyrics-toolbar input { min-height: 34px; touch-action: pan-x; }
  .lyrics-scroll { padding-right: 16px; padding-left: 16px; }

  .managed-youtube-overlay { padding: 6px; }
  .managed-youtube-dialog { width: 100%; border-radius: 12px; }
  .footer { padding: 14px 10px max(14px,env(safe-area-inset-bottom)); font-size: 13px; }
}

/* Three-bar playback row for the larger Page 2 and Page 5 cards. */
.instrumental-track,
.march-track { flex-wrap: wrap; }
.instrumental-track .button-content,
.march-track .button-content { flex: 1 1 100%; padding-right: 0; }
.instrumental-track .sound-wave-set,
.march-track .sound-wave-set {
  position: static;
  display: flex;
  width: 58px;
  height: 40px;
  flex: 0 0 58px;
  margin: 2px 0 0 32px;
  gap: 5px;
  transform: scaleX(.9);
}
.instrumental-track .controls,
.march-track .controls { width: auto; justify-content: flex-end; margin: 2px 0 0 auto; }
.instrumental-track.playing .sound-wave,
.march-track.playing .sound-wave { transform: scaleX(1); }
.instrumental-track.playing .sound-wave span:nth-child(1),
.march-track.playing .sound-wave span:nth-child(1) { animation-duration: 620ms; animation-delay: -180ms; }
.instrumental-track.playing .sound-wave span:nth-child(2),
.march-track.playing .sound-wave span:nth-child(2) { animation-duration: 840ms; animation-delay: -610ms; }
.instrumental-track.playing .sound-wave span:nth-child(3),
.march-track.playing .sound-wave span:nth-child(3) { animation-duration: 710ms; animation-delay: -340ms; }

@media (max-width: 600px) {
  .audio-tool-btn { min-width: 0; min-height: 44px; padding: 5px 7px; font-size: 12px; }
  .audio-tool-btn .control-icon { width: 20px; height: 20px; }
  .instrumental-track .sound-wave-set,
  .march-track .sound-wave-set { position: static; width: 88px; height: 40px; flex-basis: 88px; margin: 2px 0 0 18px; }
  .instrumental-track .controls,
  .march-track .controls { width: auto; margin: 2px 0 0 auto; }
}
