:root{
  --sky:#0a3051;
  --sea:#0fb3c4;
  --reef:#18d3b2;
  --sand:#f8dba5;
  --ink:#1f332c;
  --muted:#5f746b;
  --line:rgba(112, 149, 120, .22);
  --panel:#fbfdf6;
  --panel-strong:#eef6e2;
  --surface:#ffffff;
  --surface-strong:#f2f8e8;
  --focus:#ffe08a;
  --card-shadow:0 12px 30px rgba(0, 0, 0, .14);
  --radius:14px;
  --accent-green:#62e39f;
  --accent-yellow:#ffe58a;
}

*{
  box-sizing:border-box;
  -webkit-touch-callout:none;
  -webkit-user-select:none;
  user-select:none;
}

html,
body{
  margin:0;
  min-height:100%;
  color:var(--ink);
  font:14px/1.5 ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  background:
    linear-gradient(to bottom, rgba(248,219,165,0) 62%, rgba(248,219,165,.45) 100%),
    linear-gradient(to bottom, var(--sky) 0%, #0d4a6d 30%, var(--sea) 64%, #12cfc9 80%);
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  background:url("../Background/Settings.png") bottom center / cover no-repeat;
  opacity:.56;
  pointer-events:none;
  z-index:0;
}

html[data-boot="0"] .wrap{ opacity:0; }
html[data-boot="1"] .wrap{ opacity:1; transition:opacity .18s ease; }

[hidden]{ display:none !important; }

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

input,
textarea{
  -webkit-user-select:text;
  user-select:text;
}

img,
a,
button{
  -webkit-user-drag:none;
}

.wrap{
  position:relative;
  z-index:1;
  max-width:1080px;
  margin:24px auto 40px;
  padding:0 16px 24px;
  display:grid;
  gap:16px;
}

.settings-card{
  border:1px solid var(--line);
  border-radius:22px;
  background:linear-gradient(180deg, var(--panel), var(--panel-strong));
  color:var(--ink);
  box-shadow:var(--card-shadow);
}

.settings-card > *:first-child{
  margin-top:0;
}

.page-head{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:18px 24px;
  align-items:center;
  padding:22px;
}

.page-copy{
  display:grid;
  gap:6px;
}

.page-kicker,
.section-label,
.preview-label{
  display:block;
  font-size:11px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(35, 62, 49, .62);
}

h1{
  margin:0;
  font-size:clamp(28px, 4vw, 40px);
  line-height:1.03;
}

.page-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:12px;
}

.toggle-card{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:52px;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(112, 149, 120, .18);
  background:var(--surface);
}

.toggle-copy{
  display:grid;
}

.label{ font-weight:700; }
.muted{ color:var(--muted); font-size:13px; }

.switch{
  position:relative;
  flex:0 0 auto;
  width:48px;
  height:28px;
  display:inline-block;
}

.switch input{
  position:absolute;
  inset:0;
  opacity:0;
}

.slider{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:#dbe8d6;
  border:1px solid #bfd3ba;
  box-shadow:inset 0 1px 2px rgba(60, 84, 69, .12);
  transition:background .15s ease, border-color .15s ease;
}

.slider::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 3px rgba(0, 0, 0, .25);
  transition:transform .15s ease;
}

.switch input:checked + .slider{
  background:#8ccf87;
  border-color:#72bb6e;
}

.switch input:checked + .slider::after{ transform:translateX(20px); }
.switch input:disabled + .slider{ opacity:.55; }
.switch input:focus-visible + .slider{ outline:2px solid var(--focus); outline-offset:3px; }

.cta-play{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-width:122px;
  height:50px;
  padding:0 20px;
  border-radius:999px;
  font-weight:800;
  letter-spacing:.02em;
  text-decoration:none;
  color:#062617;
  background:linear-gradient(135deg, #b8f6dd 0%, #62e39f 52%, #2fc57e 100%);
  border:1px solid rgba(32, 113, 74, .28);
  box-shadow:0 14px 30px rgba(14, 92, 59, .22), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition:transform .12s ease, filter .12s ease, box-shadow .12s ease;
}

.cta-play:hover{
  filter:brightness(1.03);
  box-shadow:0 16px 34px rgba(14, 92, 59, .26), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.cta-play:active{ transform:translateY(1px) scale(.99); }
.cta-play:focus-visible{ outline:2px solid var(--focus); outline-offset:4px; }

.cta-play svg{
  width:19px;
  height:19px;
  fill:currentColor;
  flex:0 0 auto;
}

.player-card,
.music-card,
.feedback-card{
  padding:20px;
}

.player-card{
  display:grid;
  gap:18px;
}

.phead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding-bottom:12px;
  border-bottom:1px solid rgba(112, 149, 120, .14);
}

.phead h2,
.music-head h2{
  margin:0;
  font-size:22px;
  line-height:1.1;
}

.player-shell{
  display:grid;
  grid-template-columns:minmax(220px, 300px) minmax(0, 1fr);
  gap:20px;
  align-items:stretch;
}

.preview{
  display:grid;
  gap:12px;
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(112, 149, 120, .18);
  background:linear-gradient(180deg, var(--surface), var(--surface-strong));
  box-shadow:inset 0 1px 0 rgba(255, 255, 255, .7);
}

.preview-stage{
  min-height:220px;
  padding:14px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, .86), transparent 54%),
    linear-gradient(180deg, #fbfdf5, #e6f1d5);
}

.preview-stage img{
  width:min(100%, 220px);
  max-height:220px;
  object-fit:contain;
  display:block;
  filter:drop-shadow(0 16px 24px rgba(0, 0, 0, .18));
  opacity:1;
  transform:none;
  transition:opacity .16s ease, transform .16s ease;
}

.preview-stage img.is-swapping{
  opacity:.84;
  transform:translateY(2px) scale(.985);
}

.preview-copy{
  display:grid;
  gap:4px;
  padding:0 2px 2px;
}

.preview-name{
  font-size:28px;
  line-height:1.06;
}

.inst{
  max-width:18rem;
  opacity:.94;
}

.chip{
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:0 12px;
  border-radius:999px;
  background:#e2f3d2;
  border:1px solid #b7d79b;
  color:#2b4b35;
  font-weight:800;
  letter-spacing:.02em;
}

.chooser{
  display:grid;
  gap:10px;
}

.chooser-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.chooser-head:empty{
  display:none;
}

.chooser-label{
  font-size:15px;
  font-weight:700;
}

.unlock-wallet{
  display:inline-flex;
  align-items:baseline;
  gap:6px;
  margin-left:auto;
  min-height:34px;
  padding:4px 14px;
  border-radius:999px;
  border:1px solid rgba(145, 116, 36, .24);
  background:#fff2bd;
  color:#3f3415;
  font-weight:800;
  box-shadow:inset 0 1px 0 rgba(255, 255, 255, .62);
}

.wallet-count{
  font-size:16px;
  line-height:1;
}

.wallet-label{
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.unlock-status{
  min-height:0;
  color:#335347;
  font-size:13px;
  font-weight:700;
}

.unlock-status:empty{
  display:none;
}

.unlock-status.is-success{
  color:#126c43;
}

.unlock-status.is-error{
  color:#9d3c2c;
}

.grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
}

.tile{
  position:relative;
  display:grid;
  align-content:start;
  background:var(--surface);
  border:1px solid rgba(112, 149, 120, .18);
  border-radius:14px;
  padding:12px 10px;
  min-height:132px;
  cursor:pointer;
  text-align:center;
  transition:transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.tile img{
  width:100%;
  height:78px;
  object-fit:contain;
  display:block;
}

.tname{
  margin-top:8px;
  font-size:14px;
  font-weight:700;
  color:#274135;
}

.tile-meta{
  justify-self:center;
  min-height:20px;
  margin-top:7px;
  padding:2px 8px;
  border-radius:999px;
  color:#446356;
  font-size:11px;
  font-weight:800;
  line-height:1.35;
}

.tile.is-locked{
  border-style:dashed;
  background:#fbf7ea;
}

.tile.is-locked img{
  filter:grayscale(.78) opacity(.52);
  transform:scale(.94);
}

.tile.is-locked .tile-meta{
  border:1px solid rgba(145, 116, 36, .18);
  background:#fff2bd;
  color:#5a481d;
}

.tile.is-affordable{
  border-color:#d7ad3c;
  box-shadow:0 8px 16px rgba(117, 86, 18, .14);
}

.tile.is-affordable::after{
  content:"Unlock";
  position:absolute;
  top:7px;
  right:7px;
  min-height:20px;
  padding:3px 7px 2px;
  border-radius:999px;
  background:#49e19e;
  color:#062114;
  font-size:10px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.tile:hover{
  transform:translateY(-1px);
  background:#f1f8e6;
}

.tile[aria-pressed="true"]{
  border-color:#7abd69;
  background:#e3f1d5;
  box-shadow:inset 0 0 0 1px rgba(122, 189, 105, .28);
}

.tile:focus-visible,
.tbtn:focus-visible{
  outline:2px solid var(--focus);
  outline-offset:3px;
}

.music-card{
  display:grid;
  gap:18px;
  justify-items:center;
  text-align:center;
}

.music-head{
  display:grid;
  gap:8px;
  width:100%;
  justify-items:start;
  text-align:left;
  padding-bottom:14px;
  border-bottom:1px solid rgba(112, 149, 120, .16);
}

.music-head h2{
  margin:0;
  font-size:clamp(20px, 2.6vw, 24px);
}

.music-head > div{
  display:grid;
  gap:4px;
  justify-items:start;
  text-align:left;
}

.songname{
  font-weight:700;
  opacity:.96;
  letter-spacing:.01em;
}

.nowchip{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  font-weight:800;
  letter-spacing:.02em;
  color:#0a223b;
  background:#98f0cc;
  border:1px solid rgba(0, 0, 0, .08);
}

.transport{
  justify-self:center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255, 255, 255, .5);
  border:1px solid rgba(112, 149, 120, .14);
  box-shadow:inset 0 1px 0 rgba(255, 255, 255, .55);
}

.tbtn{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  border:1px solid rgba(112, 149, 120, .18);
  background:rgba(255, 255, 255, .88);
  color:#274135;
  cursor:pointer;
  box-shadow:0 8px 16px rgba(23, 55, 42, .08);
  transition:transform .12s ease, background .12s ease, box-shadow .12s ease;
}

.tbtn:hover{
  background:#f6fbef;
  box-shadow:0 10px 18px rgba(23, 55, 42, .11);
}
.tbtn:disabled{ opacity:.4; cursor:default; }

#playBtn{
  width:auto;
  min-width:78px;
  height:46px;
  padding:0 16px;
  border-radius:999px;
  border-color:rgba(32, 113, 74, .2);
  background:linear-gradient(135deg, #b8f6dd 0%, #62e39f 52%, #2fc57e 100%);
  color:#083320;
  box-shadow:0 14px 26px rgba(14, 92, 59, .18), inset 0 1px 0 rgba(255, 255, 255, .4);
  font-weight:900;
  letter-spacing:.02em;
}

#playBtn:hover{
  background:linear-gradient(135deg, #c4fae5 0%, #70e7a9 52%, #39ca86 100%);
}

.seek{
  display:grid;
  width:min(100%, 460px);
  grid-template-columns:1fr;
  justify-items:center;
  gap:10px;
}

.seek input[type="range"]{
  width:100%;
  accent-color:#98f0cc;
}

.seek input[type="range"]:disabled{
  opacity:.48;
  cursor:default;
}

#timeLabel{
  text-align:center;
}

.feedback-card{
  display:grid;
  gap:18px;
}

.feedback-form{
  display:grid;
  gap:16px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

.feedback-head{
  display:grid;
  gap:8px;
  width:100%;
  justify-items:start;
  text-align:left;
  padding-bottom:14px;
  border-bottom:1px solid rgba(112, 149, 120, .16);
}

.feedback-head h3{
  margin:0;
  font-size:clamp(20px, 2.6vw, 24px);
  line-height:1.1;
}

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

.field{
  display:grid;
  gap:8px;
}

.field span{
  font-size:13px;
  font-weight:700;
  color:#28453a;
}

.field input,
.field textarea{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(112, 149, 120, .24);
  background:rgba(255, 255, 255, .92);
  color:var(--ink);
  box-shadow:inset 0 1px 2px rgba(35, 62, 49, .05);
}

.field textarea{
  min-height:132px;
  resize:vertical;
}

.field input::placeholder,
.field textarea::placeholder{
  color:rgba(44, 68, 57, .54);
}

.field input:focus-visible,
.field textarea:focus-visible{
  outline:2px solid var(--focus);
  outline-offset:2px;
  border-color:rgba(112, 149, 120, .38);
}

.feedback-honeypot{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  overflow:hidden;
}

.feedback-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.feedback-submit{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:136px;
  min-height:48px;
  padding:0 18px;
  border:1px solid rgba(32, 113, 74, .28);
  border-radius:999px;
  background:linear-gradient(135deg, #b8f6dd 0%, #62e39f 52%, #2fc57e 100%);
  color:#062617;
  font-weight:800;
  letter-spacing:.02em;
  cursor:pointer;
  box-shadow:0 14px 30px rgba(14, 92, 59, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition:transform .12s ease, filter .12s ease;
}

.feedback-submit:hover{
  filter:brightness(1.03);
}

.feedback-submit:active{
  transform:translateY(1px) scale(.99);
}

.feedback-submit:disabled{
  cursor:wait;
  opacity:.72;
}

.feedback-status{
  margin:0;
  flex:1 1 260px;
  min-height:1.5em;
  color:#335347;
  font-size:14px;
}

.feedback-status.is-success{
  color:#126c43;
}

.feedback-status.is-error{
  color:#9d3c2c;
}

@media (max-width: 900px){
  .page-head,
  .player-shell{
    grid-template-columns:1fr;
  }

  .page-actions{
    justify-content:flex-start;
  }

  .preview-stage{
    min-height:200px;
  }

  .transport{
    justify-self:center;
  }

  .seek{
    justify-self:center;
    width:100%;
  }
}

@media (max-width: 640px){
  .wrap{
    margin:16px auto 28px;
    padding:0 12px 20px;
    gap:12px;
  }

  .settings-card,
  .player-card,
  .music-card,
  .feedback-card{
    border-radius:18px;
  }

  .page-head,
  .player-card,
  .music-card,
  .feedback-card{
    padding:16px;
  }

  .page-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .toggle-card,
  .cta-play{
    width:100%;
  }

  .cta-play{
    min-width:0;
  }

  .phead{
    align-items:flex-start;
  }

  .preview-name{
    font-size:24px;
  }

  .grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .tile img{
    height:68px;
  }

  .seek{
    grid-template-columns:1fr;
  }

  .feedback-grid{
    grid-template-columns:1fr;
  }

  .feedback-actions{
    align-items:stretch;
  }

  .feedback-submit{
    width:100%;
  }
}
