@font-face{
  font-family:"PLCFont";
  src:
    url("../assets/fonts/Phi.woff2") format("woff2"),
    url("../assets/fonts/Phi.ttf") format("truetype");
  font-weight:normal;
  font-style:normal;
  font-display:swap;
}

:root{
  --bg:#070914;
  --panel:rgba(13,18,34,.8);
  --panel-strong:rgba(18,25,45,.92);
  --line:rgba(255,255,255,.14);
  --text:#f7fbff;
  --muted:#aeb9cc;
  --cyan:#58e0ff;
  --pink:#ff6bba;
  --green:#95ffbd;
  --yellow:#ffe66d;
  --red:#ff3345;
}

*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html{
  scroll-behavior:smooth;
}

body{
  min-height:100vh;
  color:var(--text);
  background:
    linear-gradient(135deg, rgba(5,9,22,.74), rgba(9,12,28,.94)),
    image-set(
      url("../assets/bg.webp") type("image/webp"),
      url("../assets/bg.png") type("image/png")
    ) center/cover fixed;
  font-family:"PLCFont", "Microsoft YaHei", sans-serif;
  overflow-x:hidden;
  position:relative;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size:46px 46px;
  mask-image:linear-gradient(to bottom, black, transparent 75%);
}

#particles{
  position:fixed;
  inset:0;
  z-index:0;
  width:100vw;
  height:100vh;
  pointer-events:none;
  opacity:.42;
}

a{
  color:inherit;
  text-decoration:none;
}

button,
input,
select,
textarea{
  font:inherit;
}

.pool-header{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  width:min(1180px, calc(100% - 32px));
  margin:18px auto 0;
  padding:14px 18px;
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(5,8,18,.76);
  box-shadow:0 16px 44px rgba(0,0,0,.28);
  backdrop-filter:blur(16px);
}

.pool-brand{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
  font-size:18px;
}

.pool-brand img{
  display:block;
  width:42px;
  height:42px;
  object-fit:contain;
}

.pool-nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:18px;
  color:var(--muted);
  font-size:14px;
}

.pool-nav a{
  transition:color .2s ease;
}

.pool-nav a:hover,
.pool-nav a:focus-visible{
  color:var(--text);
}

.pool-page{
  position:relative;
  z-index:1;
  width:min(1180px, calc(100% - 32px));
  margin:0 auto;
  padding:36px 0 64px;
}

.pool-workbench{
  display:grid;
  grid-template-columns:minmax(0, 1.1fr) minmax(300px, .9fr);
  gap:18px;
  align-items:stretch;
}

.pool-title-block,
.pool-rule-panel,
.pool-controls,
.track-card,
.empty-state{
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
  box-shadow:0 24px 70px rgba(0,0,0,.32);
  backdrop-filter:blur(14px);
}

.pool-title-block{
  min-height:210px;
  padding:28px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.eyebrow{
  color:var(--cyan);
  font-size:13px;
  letter-spacing:2px;
  text-transform:uppercase;
}

.pool-title-block h1{
  margin-top:12px;
  font-size:clamp(48px, 7vw, 96px);
  line-height:.92;
  letter-spacing:0;
  text-shadow:
    0 0 24px rgba(88,224,255,.45),
    0 0 56px rgba(255,107,186,.2);
}

.pool-source{
  max-width:660px;
  margin-top:18px;
  color:var(--muted);
  font-size:16px;
  line-height:1.7;
  overflow-wrap:anywhere;
}

.pool-rule-panel{
  min-height:210px;
  padding:24px;
  display:grid;
  align-content:center;
  gap:10px;
  background:
    linear-gradient(135deg, rgba(88,224,255,.12), transparent 42%),
    linear-gradient(315deg, rgba(255,107,186,.16), transparent 48%),
    var(--panel-strong);
}

.pool-rule-panel span{
  color:var(--pink);
  font-size:14px;
  letter-spacing:2px;
  text-transform:uppercase;
}

.pool-rule-panel strong{
  color:#fff;
  font-size:clamp(42px, 5vw, 70px);
  line-height:1;
  font-weight:400;
}

.pool-rule-panel p{
  color:var(--muted);
  font-size:16px;
  line-height:1.7;
  overflow-wrap:anywhere;
}

.pool-controls{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:auto minmax(220px, 1fr) repeat(4, minmax(132px, .34fr));
  gap:12px;
  align-items:end;
  padding:16px;
}

.stage-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  min-width:230px;
  min-height:48px;
  padding:4px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:8px;
  background:rgba(255,255,255,.06);
}

.stage-tabs button{
  min-height:40px;
  border:0;
  border-radius:6px;
  color:var(--muted);
  background:transparent;
  cursor:pointer;
  transition:color .2s ease, background .2s ease, box-shadow .2s ease;
}

.stage-tabs button.is-active{
  color:#061018;
  background:linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow:0 8px 22px rgba(88,224,255,.2);
}

.search-box,
.select-box{
  display:grid;
  gap:7px;
}

.search-box span,
.select-box span{
  color:var(--muted);
  font-size:13px;
}

.search-box input,
.select-box select{
  width:100%;
  min-height:48px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:8px;
  padding:0 14px;
  color:var(--text);
  background:rgba(6,10,22,.72);
  outline:none;
}

.search-box input:focus,
.select-box select:focus{
  border-color:rgba(88,224,255,.7);
  box-shadow:0 0 0 3px rgba(88,224,255,.13);
}

.select-box select option{
  color:#101522;
  background:#f7fbff;
}

.track-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:18px;
}

.track-card{
  position:relative;
  min-height:70px;
  padding:14px 18px;
  overflow:hidden;
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:18px;
  align-items:center;
  background:
    linear-gradient(90deg, rgba(255,255,255,.075), transparent 52%),
    var(--panel);
  cursor:pointer;
  animation:trackRowIn .28s cubic-bezier(.42, 0, 1, 1) both;
  animation-delay:var(--row-delay, 0ms);
  transition:transform .2s ease, border-color .2s ease, background .2s ease;
}

.track-card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:1px;
  background:linear-gradient(90deg, rgba(88,224,255,.72), rgba(255,107,186,.38), transparent);
  opacity:.74;
}

.track-card:hover,
.track-card:focus-within,
.track-card:focus-visible{
  transform:translateY(-3px);
  border-color:rgba(88,224,255,.42);
  background:
    linear-gradient(90deg, rgba(88,224,255,.11), transparent 54%),
    var(--panel-strong);
  outline:none;
}

.track-card.is-liked{
  border-color:rgba(149,255,189,.28);
}

.track-main{
  min-width:0;
  display:flex;
  align-items:center;
  gap:16px;
}

.track-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  min-width:0;
  color:var(--muted);
  font-size:13px;
}

.track-pack{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  color:var(--muted);
  white-space:nowrap;
}

.track-title{
  color:#fff;
  font-size:20px;
  line-height:1.22;
  font-weight:400;
  overflow-wrap:anywhere;
}

.track-note{
  display:inline;
  max-width:100%;
  color:var(--yellow);
  font-size:13px;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.track-side{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:18px;
  min-width:max-content;
}

.track-like-count{
  min-width:58px;
  color:var(--muted);
  font-size:14px;
  line-height:1;
  text-align:right;
  white-space:nowrap;
}

.track-card.is-liked .track-like-count{
  color:var(--green);
}

.track-like-count.is-bumping,
.overview-stats strong.is-bumping{
  animation:likeCountBump .46s ease;
}

.difficulty-text{
  color:var(--text);
  font-size:15px;
  line-height:1;
  white-space:nowrap;
  text-align:right;
}

.empty-state{
  margin-top:18px;
  padding:28px;
  color:var(--muted);
  text-align:center;
}

body.overview-open{
  overflow:hidden;
}

.track-overview{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(2,5,14,.72);
  backdrop-filter:blur(12px);
  animation:overviewBackdropIn .16s cubic-bezier(.42, 0, 1, 1) both;
}

.track-overview[hidden]{
  display:none;
}

.track-overview.is-closing{
  animation:overviewBackdropOut .16s ease both;
  pointer-events:none;
}

.track-overview-panel{
  position:relative;
  width:min(1180px, calc(100vw - 36px));
  max-height:calc(100vh - 48px);
  display:grid;
  grid-template-columns:minmax(300px, .42fr) minmax(0, .58fr);
  overflow:hidden;
  border:1px solid rgba(88,224,255,.26);
  border-radius:8px;
  background:
    linear-gradient(135deg, rgba(88,224,255,.13), transparent 34%),
    linear-gradient(315deg, rgba(255,107,186,.12), transparent 48%),
    rgba(7,12,25,.96);
  box-shadow:0 34px 90px rgba(0,0,0,.52);
  animation:overviewIn .18s cubic-bezier(.42, 0, 1, 1) both;
}

.track-overview.is-closing .track-overview-panel{
  animation:overviewOut .16s ease both;
}

.overview-close{
  position:absolute;
  top:14px;
  right:14px;
  z-index:2;
  width:38px;
  height:38px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:8px;
  color:var(--text);
  background:rgba(255,255,255,.07);
  cursor:pointer;
  line-height:1;
}

.overview-close:hover,
.overview-close:focus-visible{
  border-color:rgba(88,224,255,.55);
  outline:none;
}

.overview-detail,
.overview-comments{
  min-height:0;
  padding:30px;
}

.overview-detail{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:22px;
  border-right:1px solid rgba(255,255,255,.12);
}

.overview-kicker,
.comment-header span{
  color:var(--cyan);
  font-size:13px;
  letter-spacing:1.8px;
  text-transform:uppercase;
}

.overview-detail h2{
  padding-right:32px;
  color:#fff;
  font-size:clamp(28px, 4vw, 54px);
  line-height:1.08;
  font-weight:400;
  overflow-wrap:anywhere;
}

.overview-stats{
  display:grid;
  gap:4px;
  padding:20px 0 18px;
  border-top:1px solid rgba(255,255,255,.14);
  border-bottom:1px solid rgba(255,255,255,.14);
}

.overview-stats span,
.overview-difficulty span{
  color:var(--muted);
  font-size:14px;
}

.overview-stats strong{
  color:#fff;
  font-size:clamp(76px, 11vw, 136px);
  line-height:.86;
  font-weight:400;
  text-shadow:0 0 28px rgba(88,224,255,.34);
}

.overview-difficulty{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:18px;
}

.overview-difficulty strong{
  color:#fff;
  font-size:20px;
  font-weight:400;
  white-space:nowrap;
}

.overview-like-button{
  width:100%;
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  border:1px solid rgba(149,255,189,.38);
  border-radius:8px;
  color:#061018;
  background:linear-gradient(135deg, var(--green), var(--cyan));
  cursor:pointer;
  box-shadow:0 14px 32px rgba(88,224,255,.18);
}

.overview-like-button strong{
  font-size:22px;
  line-height:1;
}

.overview-like-button.is-liked,
.overview-like-button:disabled{
  color:rgba(255,255,255,.78);
  background:rgba(255,255,255,.08);
  border-color:rgba(255,255,255,.16);
  box-shadow:none;
  cursor:default;
}

.overview-like-button.is-popping{
  animation:likePop .42s ease;
}

.overview-like-note{
  min-height:22px;
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}

.overview-comments{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.comment-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding-right:46px;
}

.comment-header strong{
  color:var(--muted);
  font-size:14px;
  font-weight:400;
}

.song-comment-list{
  min-height:180px;
  max-height:42vh;
  overflow:auto;
  padding-right:6px;
}

.song-comment-item{
  padding:14px 0;
  border-top:1px solid rgba(255,255,255,.1);
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease, padding-left .18s ease;
}

.song-comment-item:first-child{
  border-top:0;
}

.song-comment-item:hover,
.song-comment-item:focus-visible{
  padding-left:8px;
  background:rgba(255,255,255,.035);
  outline:none;
}

.song-comment-item.is-reply{
  padding-left:14px;
}

.song-comment-replies{
  margin-left:22px;
  padding-left:16px;
  border-left:1px solid rgba(255,255,255,.12);
}

.song-comment-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  color:var(--cyan);
}

.song-comment-meta strong{
  font-weight:400;
}

.comment-difficulty{
  width:28px;
  height:28px;
  display:inline-grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.24);
  border-radius:4px;
  color:#fff;
  font-size:12px;
  line-height:1;
  box-shadow:0 8px 18px rgba(0,0,0,.22);
}

.comment-difficulty-ez{
  background:#1fb86a;
}

.comment-difficulty-hd{
  background:#62b9ff;
}

.comment-difficulty-in{
  background:#e3344f;
}

.comment-difficulty-at{
  background:#6f7480;
}

.song-comment-item p{
  margin-top:8px;
  color:#f7fbff;
  font-size:16px;
  line-height:1.7;
  overflow-wrap:anywhere;
}

.song-comment-item time{
  display:block;
  margin-top:8px;
  color:rgba(174,185,204,.72);
  font-size:12px;
}

.empty-comment{
  padding:28px 0;
  color:var(--muted);
  text-align:center;
}

.song-comment-form{
  display:grid;
  gap:12px;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.12);
}

.reply-target{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:40px;
  padding:8px 10px;
  border:1px solid rgba(88,224,255,.26);
  border-radius:8px;
  color:var(--cyan);
  background:rgba(88,224,255,.08);
}

.reply-target[hidden]{
  display:none;
}

.reply-target span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.reply-target button{
  flex:0 0 auto;
  min-height:28px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:6px;
  padding:0 10px;
  color:var(--text);
  background:rgba(255,255,255,.07);
  cursor:pointer;
}

.reply-target button:hover,
.reply-target button:focus-visible{
  border-color:rgba(88,224,255,.55);
  outline:none;
}

.comment-form-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 170px;
  gap:12px;
}

.song-comment-form label{
  display:grid;
  gap:7px;
}

.song-comment-form label span{
  color:var(--muted);
  font-size:13px;
}

.song-comment-form input,
.song-comment-form select,
.song-comment-form textarea{
  width:100%;
  border:1px solid rgba(255,255,255,.14);
  border-radius:8px;
  padding:11px 12px;
  color:var(--text);
  background:rgba(6,10,22,.72);
  outline:none;
  resize:vertical;
}

.song-comment-form input:disabled{
  color:#ffe66d;
  opacity:1;
  cursor:not-allowed;
}

.song-comment-form select option{
  color:#101522;
  background:#f7fbff;
}

.song-comment-form input:focus,
.song-comment-form select:focus,
.song-comment-form textarea:focus{
  border-color:rgba(88,224,255,.7);
  box-shadow:0 0 0 3px rgba(88,224,255,.12);
}

.submit-song-comment{
  justify-self:end;
  min-width:140px;
  min-height:44px;
  border:1px solid rgba(88,224,255,.36);
  border-radius:8px;
  color:var(--text);
  background:rgba(88,224,255,.12);
  cursor:pointer;
}

.submit-song-comment:hover,
.submit-song-comment:focus-visible{
  border-color:rgba(88,224,255,.72);
  outline:none;
}

.song-comment-status{
  min-height:22px;
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}

.song-comment-status[data-tone="loading"]{
  color:var(--cyan);
}

.song-comment-status[data-tone="success"]{
  color:var(--green);
}

.song-comment-status[data-tone="error"]{
  color:#ff9db9;
}

.song-comment-form.is-submitting{
  opacity:.7;
  pointer-events:none;
}

@keyframes trackRowIn{
  from{
    opacity:0;
    transform:translateY(12px) scale(.99);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes overviewIn{
  from{
    opacity:0;
    transform:translateY(12px) scale(.985);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes overviewOut{
  from{
    opacity:1;
    transform:translateY(0) scale(1);
  }
  to{
    opacity:0;
    transform:translateY(10px) scale(.985);
  }
}

@keyframes overviewBackdropIn{
  from{
    opacity:0;
  }
  to{
    opacity:1;
  }
}

@keyframes overviewBackdropOut{
  from{
    opacity:1;
  }
  to{
    opacity:0;
  }
}

@keyframes likePop{
  0%{
    transform:scale(1);
  }
  42%{
    transform:scale(1.045);
  }
  100%{
    transform:scale(1);
  }
}

@keyframes likeCountBump{
  0%{
    transform:translateY(0);
    color:var(--muted);
  }
  42%{
    transform:translateY(-3px);
    color:var(--green);
  }
  100%{
    transform:translateY(0);
  }
}

@media(max-width:960px){
  .pool-header{
    align-items:flex-start;
    flex-direction:column;
  }

  .pool-nav{
    width:100%;
    justify-content:flex-start;
    flex-wrap:wrap;
  }

  .pool-workbench{
    grid-template-columns:1fr;
  }

  .pool-controls{
    grid-template-columns:1fr 1fr;
  }

  .stage-tabs,
  .search-box{
    grid-column:1 / -1;
  }

  .track-overview-panel{
    grid-template-columns:1fr;
    overflow:auto;
  }

  .overview-detail{
    border-right:0;
    border-bottom:1px solid rgba(255,255,255,.12);
  }

  .song-comment-list{
    max-height:none;
  }
}

@media(max-width:640px){
  body{
    background-attachment:scroll;
  }

  .pool-header,
  .pool-page{
    width:min(1180px, calc(100% - 20px));
  }

  .pool-header{
    flex-direction:row;
    align-items:center;
    gap:10px;
    margin-top:8px;
    padding:8px 10px;
  }

  .pool-brand{
    gap:6px;
    font-size:15px;
  }

  .pool-brand strong{
    display:none;
  }

  .pool-brand img{
    width:30px;
    height:30px;
  }

  .pool-nav{
    display:none;
  }

  .pool-page{
    padding-top:18px;
  }

  .pool-title-block,
  .pool-rule-panel{
    min-height:0;
    padding:22px;
  }

  .pool-source,
  .pool-rule-panel p{
    font-size:14px;
    word-break:break-all;
  }

  .pool-controls{
    grid-template-columns:1fr;
  }

  .select-box{
    grid-column:1 / -1;
  }

  .track-card{
    min-height:64px;
    grid-template-columns:1fr;
    gap:8px;
    padding:13px 14px;
  }

  .track-main{
    align-items:flex-start;
    flex-direction:column;
    gap:6px;
  }

  .track-title{
    font-size:18px;
  }

  .track-side{
    justify-content:flex-start;
    gap:14px;
    min-width:0;
  }

  .track-like-count{
    min-width:48px;
    text-align:left;
  }

  .difficulty-text{
    justify-self:start;
    align-self:auto;
    padding-top:0;
    font-size:14px;
  }

  .track-overview{
    padding:10px;
  }

  .track-overview-panel{
    width:100%;
    max-height:calc(100vh - 20px);
  }

  .overview-detail,
  .overview-comments{
    padding:22px;
  }

  .overview-detail h2{
    padding-right:34px;
    font-size:30px;
  }

  .overview-stats strong{
    font-size:76px;
  }

  .overview-difficulty{
    align-items:flex-start;
    flex-direction:column;
    gap:8px;
  }

  .comment-header{
    padding-right:42px;
  }

  .comment-form-row{
    grid-template-columns:1fr;
  }

  .song-comment-replies{
    margin-left:8px;
    padding-left:10px;
  }

  .submit-song-comment{
    justify-self:stretch;
  }
}

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