:root{
  --bg: #eef3f2;
  --paper: #FFFFFF;
  --ink: #2B3A36;
  --ink-soft: #5C6B67;
  --sage:   #5C8374;
  --rose:   #C97064;
  --ochre:  #D4A24C;
  --indigo: #3E5C76;
  --teal:   #2E7A80;
  --plum:   #7D5A76;
  --radius: 22px;
}

*{ box-sizing: border-box; }

html, body{
  margin:0; padding:0; background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
  min-height: 100vh;
}

body{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding: 32px 16px 80px;
}

header{
  text-align:center;
  margin-bottom: 20px;
}

h1{
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-weight:700;
  font-size: clamp(32px, 8vw, 52px);
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: 1px;
}

header p{
  margin:0;
  color: var(--ink-soft);
  font-size: 16px;
}

.tabs{
  display:flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  background: var(--paper);
  padding: 6px;
  border-radius: 999px;
  margin-bottom: 24px;
  box-shadow: 0 2px 0 rgba(43,58,54,0.06);
}

.tab{
  border: none;
  background: transparent;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.tab.active{
  background: var(--indigo);
  color: #fff;
}

.tab:focus-visible{
  outline: 3px solid var(--indigo);
  outline-offset: 2px;
}

.panel{ display:none; width:100%; max-width: 640px; }
.panel.active{ display:block; }

.shelf{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.book{
  --accent: var(--sage);
  position: relative;
  display:flex;
  align-items:center;
  gap: 16px;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px 18px 14px 14px;
  border: none;
  width:100%;
  text-align:left;
  cursor:pointer;
  box-shadow: 0 2px 0 rgba(43,58,54,0.06);
  transition: transform .18s ease, box-shadow .18s ease;
  font-family: inherit;
}

.book.sage{   --accent: var(--sage); }
.book.rose{   --accent: var(--rose); }
.book.ochre{  --accent: var(--ochre); }
.book.indigo{ --accent: var(--indigo); }
.book.teal{   --accent: var(--teal); }
.book.plum{   --accent: var(--plum); }

.book:active{ transform: scale(0.98); }

.book:focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.spine{
  flex: 0 0 14px;
  align-self: stretch;
  border-radius: 10px;
  background: var(--accent);
  transition: flex-basis .25s ease;
}

.book.playing .spine{ flex-basis: 22px; }

.play-icon{
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  display:flex;
  align-items:center;
  justify-content:center;
}

.play-icon svg{ width: 22px; height: 22px; fill: #fff; }

.info{ flex: 1 1 auto; min-width: 0; }

.title{
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status{
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
  height: 16px;
}

.meta-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-top: 6px;
}

.action-btn{
  display:inline-flex;
  align-items:center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.action-btn:hover{
  text-decoration: underline;
}

.progress-track{
  height: 4px;
  background: #E7ECEA;
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill{
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
}

.book.playing{ box-shadow: 0 4px 14px rgba(43,58,54,0.12); }

@keyframes pulse{
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

.book.playing .play-icon{ animation: pulse 1.6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce){
  .book, .spine{ transition: none; }
  .book.playing .play-icon{ animation: none; }
}

.pager{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 16px;
  margin-top: 20px;
}

.pager-btn{
  border: none;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(43,58,54,0.06);
}

.pager-btn:disabled{
  opacity: .4;
  cursor: default;
}

.pager-info{
  color: var(--ink-soft);
  font-size: 14px;
}

.music-subtabs{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.subtab{
  border: none;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(43,58,54,0.06);
}

.subtab.active{
  background: var(--indigo);
  color: #fff;
}

.sports-subtabs{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.sports-subtab{
  border: none;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(43,58,54,0.06);
}

.sports-subtab.active{
  background: var(--teal);
  color: #fff;
}

.learning-card{
  background: var(--paper);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 0 rgba(43,58,54,0.06);
}

.learning-form{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.learning-label{
  font-weight: 600;
  color: var(--ink);
}

.learning-title-input,
.learning-notes-input{
  width: 100%;
  border: 1px solid #dfe7e4;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fafdfc;
}

.learning-notes-input{
  min-height: 120px;
  resize: vertical;
}

.learning-submit{
  align-self: flex-start;
  border: none;
  background: var(--indigo);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.learning-actions{
  display:flex;
  gap: 8px;
  margin-top: 10px;
}

.learning-action-btn{
  border: none;
  background: transparent;
  color: var(--indigo);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.learning-action-btn.delete{
  color: var(--rose);
}

.learning-list{
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.learning-item{
  background: #f7fbfa;
  border: 1px solid #e3ece8;
  border-radius: 16px;
  padding: 14px;
}

.learning-item h3{
  margin: 0 0 6px;
  font-size: 18px;
}

.learning-item p{
  margin: 0;
  color: var(--ink-soft);
  white-space: pre-line;
  line-height: 1.6;
}

.learning-meta{
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.learning-empty{
  color: var(--ink-soft);
  text-align: center;
  padding: 20px 0;
}

.sports-upload-form{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top: 16px;
}

.sports-upload-input{
  width:100%;
  border: 1px solid #dfe7e4;
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  background: #fafdfc;
}

.sports-upload-btn{
  align-self:flex-start;
  border:none;
  background: var(--teal);
  color:#fff;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.sports-folder-status{
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.sports-gallery{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.sports-photo-card{
  background: #f7fbfa;
  border: 1px solid #e3ece8;
  border-radius: 16px;
  overflow: hidden;
}

.sports-photo-card img{
  width:100%;
  aspect-ratio: 4 / 3;
  object-fit:cover;
  display:block;
}

.sports-photo-caption{
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.about-card{
  background: var(--paper);
  border-radius: var(--radius);
  padding: 32px 26px;
  text-align:center;
  box-shadow: 0 2px 0 rgba(43,58,54,0.06);
}

.avatar{
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--indigo);
  color: #fff;
  font-size: 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 0 auto 14px;
}

.about-card h2{
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  margin: 0 0 10px;
  font-size: 24px;
}

.about-card p{
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
  white-space: pre-line;
}

footer{
  margin-top: 40px;
  color: var(--ink-soft);
  font-size: 13px;
  text-align:center;
}

.video-modal{
  position: fixed;
  inset: 0;
  background: rgba(20, 27, 25, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.video-modal.open{
  display: flex;
}

.video-card{
  width: min(900px, 100%);
  background: var(--paper);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(43,58,54,0.24);
}

.video-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.video-close{
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
}

.video-frame{
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 14px;
  background: #000;
}
