:root{
  --bg:#0a0a0a;
  --fg:#f2f2f2;
  --muted: rgba(242,242,242,0.72);
  --line: rgba(242,242,242,0.16);
  --glass: rgba(10,10,10,0.2);
  --accent:#e6e6e6;
  --strike:#68C0C0;
}

:root{
  --hud-bottom: 18px;
  --hud-side: 24px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }

body{
  display:grid;
  place-items:center;
  background: var(--bg);
  color: var(--fg);
  font-family: "Roboto Mono", monospace;
  overflow:hidden;
}

body, .wrap, .panel, .row, .pill, .top, .sub, .msg, button, label {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#cover, .cover-wrap img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

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

.wrap{
  width:min(820px, 92vw);
  padding: 24px 0;
}

.top h1{
  margin:0 0 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.9;
  font-size: clamp(28px, 4.8vw, 62px);
  transform: scaleX(1.06);
  opacity: 0.98;
}

.sub{
  margin:0 0 18px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.3px;
  opacity: 0.75;
}

.panel{
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 10px 0 14px;
  position: relative;
}

.pill{
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.3px;
  opacity: 0.82;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
}

.pill-select{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding-right: 12px;
}

.pill-select .caret{
  opacity: 0.75;
  font-size: 12px;
  transform: translateY(-0.5px);
}

.tier-menu{
  position: absolute;
  z-index: 80;
  margin-top: 8px;
  min-width: 220px;
  max-width: min(92vw, 340px);
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}

.tier-menu button{
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: transparent;
  color: var(--fg);
  opacity: 0.85;
  text-transform: none;
}

.tier-menu button:hover{
  opacity: 1;
  background: rgba(255,255,255,0.06);
}

.tier-menu button:last-child{
  border-bottom: 0;
}

.tier-menu button[disabled]{
  opacity: 0.35;
}

.pill.preview{
  border-color: rgba(242,242,242,0.35);
  opacity: 1;
}

.pill-select.locked{
  opacity: 0.45;
  cursor: default;
}
.pill-select.locked .caret{
  opacity: 0.35;
}

.pill-select.locked:hover{
  opacity: 0.45;
}

.art{
  width:100%;
  display:grid;
  place-items:center;
  margin: 10px 0 16px;
}
.art img{
  width: min(340px, 70vw);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0;
  border: 1px solid var(--line);
  background: #050505;
  box-shadow: 0 1px 18px rgba(0,0,0,0.55);
}

.controls{ display:flex; gap:10px; margin: 12px 0 12px; }
.actions{ display:flex; gap:10px; margin-top: 10px; }

button{
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  opacity: 0.82;
  cursor:pointer;
}

button:hover{ opacity: 1; }
button:disabled{
  opacity: 0.45;
  cursor: default;
}

.qa label{
  display:block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 10px 0 8px;
  opacity: 0.72;
}

#answer{
  width:100%;
  padding: 12px 12px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.35);
  color: var(--fg);
  outline: none;
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.2px;
}
#answer:focus{
  border-color: rgba(242,242,242,0.40);
}

.suggestions{
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  background: rgba(0,0,0,0.80);
  backdrop-filter: blur(8px);
}

.suggestions button{
  width:100%;
  text-align:left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  opacity: 0.82;
  text-transform:none;
}

.suggestions button.active{
  background: rgba(255,255,255,0.08);
  opacity: 1;
  border-left: 3px solid #ffffff;
}

.suggestions button.active .suggtitle{
  font-weight: 700;
  color: #ffffff;
}

.suggestions button.active .suggimg{
  border-color: #ffffff;
}

.suggestions button:last-child{ border-bottom: 0; }
.suggestions button:hover{ opacity: 1; }

.suggimg{
  width: 34px;
  height: 34px;
  border-radius: 0;
  object-fit: cover;
  border: 1px solid var(--line);
  background:#050505;
  flex: 0 0 auto;
}
.suggtitle{
  flex: 1 1 auto;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.msg{
  margin-top: 12px;
  min-height: 20px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.3px;
  opacity: 0.8;
}

#rewardPanel h2{
  margin: 0 0 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transform: scaleX(1.06);
}
#rewardPanel a{
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 10px 12px;
  display:inline-block;
  margin-top: 10px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.3px;
  opacity: 0.82;
}
#rewardPanel a:hover{ opacity: 1; }

#strikesPill{
  mix-blend-mode: difference;
}

.timebar{
  width: 100%;
  height: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.35);
  margin: 6px 0 12px;
  overflow: hidden;
}
.timebar-fill{
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 60ms linear;
  opacity: 0.9;
}

.msg{
  margin-top: 14px;
  min-height: 34px;
  font-size: 12px;
  letter-spacing: 0.35px;
}
.msg.flash{
  animation: msgFlash 520ms steps(2, end) 2;
  opacity: 1;
}

.msg.docked{
  position: fixed;
  left: 12px;
  right: 12px;
  z-index: 70;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(242,242,242,0.16);
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
}

@keyframes msgFlash{
  0%{ opacity: 1; }
  50%{ opacity: 0.15; }
  100%{ opacity: 1; }
}

.cover-wrap{
  position: relative;
  width: min(340px, 70vw);
  aspect-ratio: 1 / 1;
}

.cover-wrap img{
  width: 100%;
  height: 100%;
  display: block;
}

.cover-mark{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(56px, 10vw, 120px);
  letter-spacing: 0.02em;
  transform: scaleX(1.06);
  pointer-events: none;
  user-select: none;

  color: #fff;
  -webkit-text-stroke: 3px rgba(0,0,0,0.85);
  text-shadow: 0 10px 35px rgba(0,0,0,0.55);
}

.cover-mark.tick{
  color: #ffffff;
  animation: markPop 520ms ease-out 1;
}

.cover-mark.x{
  color: #ffffff;
  animation: markShake 650ms ease-out 1;
}

@keyframes markPop{
  0%{ opacity: 0; transform: scaleX(1.06) scale(0.92); }
  35%{ opacity: 1; transform: scaleX(1.06) scale(1.02); }
  100%{ opacity: 0; transform: scaleX(1.06) scale(1.00); }
}

@keyframes markShake{
  0%{ opacity: 0; transform: scaleX(1.06) scale(0.98); }
  15%{ opacity: 1; transform: scaleX(1.06) translateX(-6px); }
  30%{ transform: scaleX(1.06) translateX(6px); }
  45%{ transform: scaleX(1.06) translateX(-4px); }
  60%{ transform: scaleX(1.06) translateX(4px); }
  100%{ opacity: 0; transform: scaleX(1.06) translateX(0); }
}

.msg{
  margin-top: 16px;
  min-height: 44px;
  font-size: 13px;
  letter-spacing: 0.35px;
  opacity: 0.95;
  color: rgba(242,242,242,0.92);
}

.msg.loud{
  color: #ffffff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transform: scaleX(1.06);
}

.msg.flash{
  animation: msgFlash2 720ms steps(2, end) 2;
}

@keyframes msgFlash2{
  0%{ opacity: 1; }
  50%{ opacity: 0.08; }
  100%{ opacity: 1; }
}

.controls{
  align-items: center;
}

.waveform{
  flex: 1 1 auto;
  height: 34px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  opacity: 0.9;
  display:block;
}
.waveform.loading{
  opacity: 0.55;
  filter: blur(0.2px);
}

.copyright{
  position: fixed;
  line-height: 1.2;
  left: var(--hud-side);
  bottom: calc(var(--hud-bottom) + env(safe-area-inset-bottom, 0px));
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 0.3px;
  color: #ffffff;
  mix-blend-mode: difference;
  z-index: 60;
}

.vol{
  position: fixed;
  right: 24px;
  bottom: 50px;
  z-index: 60;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 10px;
  pointer-events: auto;
}

.vol-btn{
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 0;
  border: 1px solid rgba(242,242,242,0.16);
  background: transparent;
  color: #fff;
  opacity: 0.75;
}

.vol-btn:hover{ opacity: 1; }

.vol-slider{
  width: 140px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  transform-origin: right center;
}

.vol.open .vol-slider{
  opacity: 1;
  pointer-events: auto;
}

.vol-slider{
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-runnable-track{
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.vol-slider::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid rgba(0,0,0,0.8);
  border-radius: 50%;
  margin-top: -4px;
  transition: transform 0.12s ease;
}

.vol-slider::-webkit-slider-thumb:hover{
  transform: scale(1.15);
}

.vol-slider::-moz-range-track{
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.vol-slider::-moz-range-thumb{
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid rgba(0,0,0,0.8);
  border-radius: 50%;
  cursor: pointer;
}

html, body{
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

button, a, .clickable{
  touch-action: manipulation;
}

#strikesPill{
  position: relative;
  transform: translateZ(0);
}

#strikesPill.holding{
  opacity: 1;
  transform: scale(0.97);
  border-color: rgba(242,242,242,0.32);
  background: rgba(0,0,0,0.28);
}

#strikesPill.holding::after{
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  background: rgba(242,242,242,0.7);
  transform-origin: left center;
  transform: scaleX(var(--holdp, 0));
  opacity: 0.9;
}


@media (max-width: 520px){

  html, body { overflow-x: hidden; }

  #panel{
    padding: 12px 12px;
  }

  canvas#waveform,
  #waveform{
    display: block;
    max-width: 100%;
  }

  :root{
    --hud-bottom: 18px;
    --hud-side: 14px;
  }

  .copyright{
    font-size: 9px;
    opacity: 0.35;
    z-index: 60;
  }

  .wrap{
    padding: 14px 0;
  }

  .top h1{
    margin-bottom: 6px;
  }

  .top{
    margin-bottom: 6px;
  }

  button{
    min-height: 44px;
  }

  #answer{
    font-size: 16px;
  }

  body{
    overflow-x: hidden;
  }

  .controls{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #btnPlay{
    width: 100%;
  }

  .waveform{
    width: 100%;
    max-width: 100%;
  }

  .copyright{
    left: var(--hud-side);
    bottom: calc(var(--hud-bottom) + env(safe-area-inset-bottom, 0px));
    font-size: 9px;
    line-height: 1.2;
    opacity: 0.35;
    z-index: 60;
  }

  .suggestions{
    background: #000;
    z-index: 50;
    position: relative;
    max-height: 38vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .suggestions{
    touch-action: pan-y;
	box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  }

  .suggestions button{
    padding: 14px 14px;
	touch-action: pan-y;
  }

  #volUI{
    display: none;
  }

  .sub{
    display: none;
  }

  .row{
    align-items: center;
    gap: 8px;
  }

  #strikesPill{
    margin-left: auto;
    padding: 6px 8px;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
  }

  #strikesPill .label,
  
  #strikesPill .strikeLabel{ display: none; }

  #strikesPill{ mix-blend-mode: normal; }

  #strikesPill .dot,
  #strikesPill i,
  #strikesPill b{
    opacity: 0.95;
  }

  #tierName{ order: 1; }
  #progress{ order: 2; }

  #timer{ order: 3; }
  #strikesPill{ order: 4; }

  #timer, #strikesPill{
    white-space: nowrap;
  }

  #strikesPill{
    padding: 6px 8px;
    font-size: 10px;
    gap: 5px;
  }

  #strikesPill .strikeDot{
    width: 6px;
    height: 6px;
    margin: 0;
  }

  #timer{ margin-right: 0; }

  .pill{
	height: 28px;
	display: inline-flex;
	align-items: center;
    padding: 0px 8px;
    font-size: 10px;
  }

#tierName{
  min-height: 0;
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  font-size: 10px;
}

#tierName.pill-select{
  padding-right: 8px;
  gap: 6px;
}

#tierName .caret{
  font-size: 10px;
  transform: none;
}

.tier-menu{
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}


}

#rewardPanel #statsBox,
#rewardPanel #statsBox * {
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

#rewardPanel button {
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

#msg {
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

#msg::selection {
  background: #ffffff;
  color: #000000;
}

.ytad{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  padding: 8px 10px;
  pointer-events: none;
}

.ytad-inner{
  pointer-events: auto;
  margin: 0 auto;
  width: min(980px, calc(100vw - 20px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.ytad-label{
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.2px;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid rgba(242,242,242,0.22);
  background: rgba(242,242,242,0.10);
  color: rgba(242,242,242,0.92);
  user-select: none;
}

.ytad-link{
  display: block;
  line-height: 0;
}

.initialsHiddenInput{
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ytad-img{
  display: block;
  width: 100%;
  max-height: 110px;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  object-fit: contain;
}

.ytad-close{
  appearance: none;
  border: 1px solid rgba(242,242,242,0.22);
  background: rgba(242,242,242,0.08);
  color: rgba(242,242,242,0.92);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.ytad-close:hover{
  background: rgba(242,242,242,0.14);
}

@media (max-width: 520px){
  .ytad{ display:none !important; }
}

.lbRows{
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.92;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 6px;
  border-top: 1px solid rgba(242,242,242,0.08);
}
.lbRows::-webkit-scrollbar{ width: 10px; }
.lbRows::-webkit-scrollbar-thumb{
  background: rgba(242,242,242,0.14);
  border: 2px solid rgba(0,0,0,0.65);
  border-radius: 999px;
}
.lbRows::-webkit-scrollbar-track{ background: rgba(0,0,0,0.15); }

body.modalOpen{
  overflow: hidden;
}

.initialsOverlay{
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(10px);
}

.initialsModal{
  width: min(520px, calc(100vw - 24px));
  border: 1px solid rgba(242,242,242,0.18);
  background: rgba(0,0,0,0.82);
  box-shadow: 0 20px 70px rgba(0,0,0,0.7);
  padding: 16px 16px 14px;
}

.initialsTitle{
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: scaleX(1.06);
}

.initialsSub{
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.35px;
  opacity: 0.75;
}

.initialsBoxes{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.initialsCell{
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242,242,242,0.18);
  background: rgba(0,0,0,0.25);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.06em;
  transform: scaleX(1.06);
  user-select: none;
}

.initialsCell.active{
  border-color: rgba(242,242,242,0.55);
  box-shadow: 0 0 0 2px rgba(242,242,242,0.06) inset;
  animation: initialsBlink 900ms steps(2, end) infinite;
}

@keyframes initialsBlink{
  0%{ background: rgba(0,0,0,0.25); }
  50%{ background: rgba(255,255,255,0.06); }
  100%{ background: rgba(0,0,0,0.25); }
}

.initialsModal{ position: relative; }

.initialsHiddenInput{
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    inset: 0;
    opacity: 0;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    outline: none;

    pointer-events: none;
  }  

.copyright{
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

.initialsHint{
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.3px;
  opacity: 0.65;
}

.initialsBtns{
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.initialsBtn{
  min-width: 90px;
}

.initialsOverlay[hidden] { 
  display: none
}
