:root{
  --panel: rgba(15,16,20,.72);
  --panel2: rgba(255,255,255,.12);
  --shadow: 0 18px 44px rgba(0,0,0,.55);
  --shadow2: 0 10px 18px rgba(0,0,0,.45);
  --radius: 22px;
  --text:#f5f5f5;
  --muted:#d8d8d8;
  --btn1:#0f1116;
  --btn2:#2b2e3a;
  --gold1:#ffcc4d;
  --gold2:#ff7a00;
}

*{
  box-sizing:border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body{
  height:100%;
  margin:0;
  padding:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  overflow:hidden;
  touch-action:none;
  background:#050506;
}

img{
  user-select:none;
  -webkit-user-drag:none;
}

button{
  font-family:inherit;
}

#app{
  position:fixed;
  inset:0;
  z-index:1;
  width:100vw;
  height:100vh;
}

.app-bg{
  position:fixed;
  inset:0;
  z-index:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.24), rgba(0,0,0,.52)),
    url("./Imagens/fundoMenu.png") center / cover no-repeat,
    #08090b;
  transition: opacity .18s ease, filter .18s ease, background .18s ease;
}

.screen{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:1;
  overflow:hidden;
}

.screen.active{
  display:flex;
}

.panel-screen{
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  overflow-y:auto;
  background:linear-gradient(rgba(5,1,13,.68), rgba(5,1,13,.92));
}

.game-screen{
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  background:linear-gradient(rgba(5,1,13,.15), rgba(5,1,13,.45));
}

.sound-btn{
  position:fixed;
  top:calc(14px + env(safe-area-inset-top));
  left:calc(14px + env(safe-area-inset-left));
  z-index:9999;
  width:46px;
  height:46px;
  border-radius:50%;
  border:2px solid #f5d47a;
  background:rgba(0,0,0,.65);
  color:#f5d47a;
  font-size:22px;
  cursor:pointer;
  box-shadow:0 0 15px rgba(245,212,122,.5);
}

.menu-content{
  width:min(520px, 92vw);
  padding:18px;
  border-radius:var(--radius);
  background:rgba(10,10,12,.46);
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  backdrop-filter:blur(8px);
}

.menu-img-btn{
  width:min(360px, 88vw);
  border:0;
  padding:0;
  margin:0;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  filter:drop-shadow(0 14px 18px rgba(0,0,0,.36));
  transition:transform .08s ease, filter .12s ease;
}

.menu-img-btn img{
  width:100%;
  height:auto;
  display:block;
}

.menu-img-btn:active{
  transform:translateY(2px) scale(.99);
  filter:brightness(.94) drop-shadow(0 8px 12px rgba(0,0,0,.34));
}

.menu-img-btn:focus{
  outline:none;
}

h1{
  margin:45px 0 15px;
  color:#ffd36b;
  text-shadow:0 0 15px #ff9d00;
  text-align:center;
}

.starsText{
  font-size:22px;
  font-weight:bold;
}

.cards{
  width:min(92vw, 760px);
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:15px;
  padding-bottom:30px;
}

.card{
  background:rgba(0,0,0,.65);
  border:2px solid #9b7335;
  border-radius:16px;
  padding:12px;
  text-align:center;
  box-shadow:0 0 18px rgba(255,184,77,.25);
}

.card img{
  width:100%;
  height:120px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.25);
}

.card h3{
  margin:10px 0;
  color:#ffd36b;
}

.card button,
.backBtn,
#continueBtn,
#restartBtn,
#playAgainBtn,
#exitGameBtn{
  border:2px solid #f5d47a;
  border-radius:12px;
  background:linear-gradient(#6b3d16, #2d1609);
  color:#ffd36b;
  font-weight:bold;
  padding:12px 16px;
  cursor:pointer;
  box-shadow:0 0 12px rgba(245,212,122,.35);
}

.card button:disabled{
  opacity:.45;
}

.backBtn,
#continueBtn,
#restartBtn,
#playAgainBtn{
  margin:10px;
  font-size:16px;
}

.record-box{
  background:rgba(0,0,0,.65);
  border:2px solid #f5d47a;
  border-radius:18px;
  padding:30px;
  width:min(90vw, 420px);
  text-align:center;
}

.record-box strong{
  font-size:42px;
  color:#ffd36b;
}

#hud{
  width:min(96vw, 720px);
  margin-top:max(58px, calc(58px + env(safe-area-inset-top)));
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:7px;
  background:rgba(0,0,0,.65);
  border:2px solid rgba(245,212,122,.8);
  padding:10px;
  border-radius:14px;
  font-size:14px;
  text-align:center;
  z-index:2;
}

#track{
  position:relative;
  width:min(96vw, 520px);
  flex:1;
  min-height:260px;
  max-height:680px;
  margin-top:10px;
  display:flex;
  overflow:hidden;
  border:3px solid #8e5cff;
  border-radius:18px;
  background:linear-gradient(to bottom, rgba(18,8,32,.85), rgba(0,0,0,.9));
  box-shadow:0 0 30px rgba(142,92,255,.5);
  z-index:2;
}

.lane{
  position:relative;
  flex:1;
  border-left:1px solid rgba(255,255,255,.15);
  border-right:1px solid rgba(255,255,255,.15);
}

.touch-pad{
  position:absolute;
  bottom:20px;
  left:50%;
  width:58px;
  height:58px;
  transform:translateX(-50%);
  border-radius:50%;
  border:3px solid white;
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:5;
  font-size:28px;
  user-select:none;
}

.lane[data-key="0"] .touch-pad{
  background:radial-gradient(circle at top, #ffffff, #00ff66 45%, #003b18);
  box-shadow:0 0 22px #00ff66;
}

.lane[data-key="1"] .touch-pad{
  background:radial-gradient(circle at top, #ffffff, #ff2b2b 45%, #430000);
  box-shadow:0 0 22px #ff2b2b;
}

.lane[data-key="2"] .touch-pad{
  background:radial-gradient(circle at top, #ffffff, #ffe600 45%, #4a3b00);
  box-shadow:0 0 22px #ffe600;
}

.lane[data-key="3"] .touch-pad{
  background:radial-gradient(circle at top, #ffffff, #1e90ff 45%, #001d4d);
  box-shadow:0 0 22px #1e90ff;
}

.lane.active .touch-pad{
  transform:translateX(-50%) scale(1.15);
  box-shadow:0 0 30px white;
}

.note{
  position:absolute;
  top:-60px;
  left:50%;
  width:48px;
  height:48px;
  transform:translateX(-50%);
  border-radius:50%;
  z-index:3;
}

.lane[data-key="0"] .note{
  background:radial-gradient(circle at 30% 20%, #ffffff, #00ff66 35%, #008c35 70%);
  box-shadow:0 0 24px #00ff66;
}

.lane[data-key="1"] .note{
  background:radial-gradient(circle at 30% 20%, #ffffff, #ff2b2b 35%, #9b0000 70%);
  box-shadow:0 0 24px #ff2b2b;
}

.lane[data-key="2"] .note{
  background:radial-gradient(circle at 30% 20%, #ffffff, #ffe600 35%, #b99600 70%);
  box-shadow:0 0 24px #ffe600;
}

.lane[data-key="3"] .note{
  background:radial-gradient(circle at 30% 20%, #ffffff, #1e90ff 35%, #004fb8 70%);
  box-shadow:0 0 24px #1e90ff;
}

#hit-line{
  position:absolute;
  bottom:85px;
  width:100%;
  height:5px;
  background:#ffffff;
  box-shadow:0 0 20px #ffffff;
  z-index:2;
}

#message{
  min-height:24px;
  text-align:center;
  font-weight:bold;
  text-shadow:0 0 8px black;
  z-index:2;
}

#exitGameBtn{
  margin-bottom:max(12px, env(safe-area-inset-bottom));
  z-index:2;
}

#gameOverText,
#finishText{
  width:min(90vw, 500px);
  text-align:center;
  font-size:20px;
}

.special-note{
  background:
    radial-gradient(circle at center,
    #ffffff 0%,
    #ffffff 35%,
    #d7ecff 70%,
    #9ad0ff 100%) !important;

  box-shadow:
    0 0 12px #ffffff,
    0 0 28px #ffffff,
    0 0 55px #8fd1ff !important;

  border:2px solid #ffffff;
  animation:specialPulse .35s infinite alternate;
}

.special-active #track{
  border-color:#ffffff;
  box-shadow:
    0 0 25px rgba(255,255,255,.75),
    0 0 55px rgba(143,209,255,.7);
}

.special-active .lane{
  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,.22),
      rgba(120,180,255,.16)
    ) !important;

  box-shadow:
    inset 0 0 25px rgba(255,255,255,.35),
    0 0 20px rgba(255,255,255,.25);

  transition:.15s;
}

.special-active .lane.active{
  box-shadow:
    0 0 25px #ffffff,
    0 0 50px #8ecfff,
    inset 0 0 25px rgba(255,255,255,.6);
}

.special-active .touch-pad{
  background:
    radial-gradient(circle at top,
    #ffffff,
    #eaf7ff 45%,
    #84cfff) !important;

  box-shadow:
    0 0 22px #ffffff,
    0 0 44px #8fd1ff !important;

  border-color:#ffffff !important;
}

@keyframes specialPulse{
  from{
    transform:translateX(-50%) scale(1);
    filter:brightness(1);
  }

  to{
    transform:translateX(-50%) scale(1.08);
    filter:brightness(1.45);
  }
}

@media (max-width:520px){
  #hud{
    font-size:12px;
  }

  .touch-pad{
    width:48px;
    height:48px;
  }

  .note{
    width:42px;
    height:42px;
  }
}