/* ==========================================
   오작교 꼬마 통합연주기 v1.0.0
   ========================================== */

/* 1. Reset & Global Styles
   ------------------------------------------ */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-width: 0;
}

body {
  background: transparent;/* 원본 색상 background: #f8f5ef;*/
  color: #253044;
  font-family: "맑은 고딕", Arial, sans-serif;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible, 
input:focus-visible {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

input {
  accent-color: #526d65;
}

[hidden] {
  display: none !important;
}

/* 2. Layout & Container
   ------------------------------------------ */
#oj-popup {
  padding: var(--outer-y, 12px) var(--outer-x, 12px);
  width: 100%;
  min-width: 0;
}

.popup-player {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap, 5px);
  width: 100%;
  max-width: var(--player-width, 455px);
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  padding: var(--inner-padding, 12px);
  background: #fff;
  border: 1px solid #e5dfd7;
  border-radius: 15px;
  box-shadow: 0 5px 20px #30251c0d;
  overflow: hidden;
}

/* 3. Hero Section
   ------------------------------------------ */
.hero {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--hero-height, 85px);
  background: linear-gradient(135deg, #243c34, #465953);
  color: #fff;
  text-align: center;
  border-radius: 12px;
  overflow: hidden;
}

.hero-text {
  width: 100%;
  padding: 14px 12px;
}

.hero h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.hero p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #d8e7dd;
  line-height: 1.5;
}

.hero img {
  display: block;
  width: 100%;
  height: var(--hero-height, 85px);
  object-fit: contain;
  background: #f5f8f0;
}

.hero:has(img:not([hidden])):after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 -12px 16px -12px #203a30aa;
  border-radius: inherit;
}

/* 4. Player Body & Header
   ------------------------------------------ */
.player-body {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap, 5px);
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.head {
  flex: none;
  padding: 10px;
  background: linear-gradient(120deg, #eef4ef, #fafcfb);
  border: 1px solid #dbe5df;
  border-left: 4px solid #526d65;
  border-radius: 12px;
}

.title {
  color: #253044;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* 5. Seekbar & Controls
   ------------------------------------------ */
.seekrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #526d65;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

#seek {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 16px;
  margin: 0;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.controls button {
  min-width: 28px;
  min-height: 32px;
  padding: 3px;
  background: #fff;
  color: #526d65;
  font-size: 16px;
  border: 1px solid #dbe5df;
  border-radius: 8px;
}

.controls button.active {
  background: #e1ece6;
  color: #365f46;
}

.transport {
  display: flex;
  gap: 4px;
}

#play {
  min-width: 42px;
  background: #526d65;
  color: #fff;
  font-size: 19px;
}

#volume {
  width: 52px;
  max-width: 18%;
  margin: 0;
}

/* 6. Song List & Items
   ------------------------------------------ */
.songs {
  flex: none;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  background-color: #fff;
  background-position: right bottom;
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid #e0e5e1;
  border-radius: 12px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #a8b8af transparent;
}

.popup-player[data-fixed="true"] .songs {
  flex: 1;
  height: auto !important;
  min-height: 0;
}

.songs ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.songs li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.songs button {
  background: transparent;
  border: 0;
}

.song {
  flex: 1;
  min-width: 0;
  padding: 0px 5px; /*리스트 목록 간격 */
  color: #253044;
  font-size: var(--list-font-size, 14px);
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
}

.song:hover {
  color: #f45e02;
}

.selected .song {
  color: #e64a19;
  font-weight: 700;
}

.remove {
  flex: none;
  padding: 4px;
  color: #8c9c94;
  font-size: 17px;
}

.remove:hover {
  color: #c84132;
}

#status {
  margin: 6px 4px;
  color: #68786e;
  font-size: 12px;
  line-height: 1.6;
}

#status:empty {
  display: none;
}

/* 7. Media Queries
   ------------------------------------------ */
@media (max-width: 340px) {
  .hero h1 {
    font-size: 18px;
  }
  
  .head {
    padding: 8px;
  }
  
  .controls {
    gap: 3px;
  }
  
  .controls button {
    min-width: 26px;
  }
  
  #volume {
    width: 42px;
  }
}