:root{
  --gold:#e0a53c;
  --navy:#1c2b4a;
  --green:#1f7a4d;
  --red:#c23b3b;
  --cream:#fdf6e6;
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html,body{
  margin:0;
  padding:0;
  height:100%;
  background:#0b0f1a;
  font-family:'Segoe UI', Arial, Helvetica, sans-serif;
  overflow:hidden;
}

#app{
  position:relative;
  width:100%;
  max-width:480px;
  height:100vh;
  max-height:900px;
  margin:0 auto;
  background:#0b0f1a;
  overflow:hidden;
  box-shadow:0 0 40px rgba(0,0,0,.6);
}

#logo{
  position:absolute;
  top:10px;
  left:10px;
  width:84px;
  height:auto;
  z-index:50;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.5));
  pointer-events:none;
}

.screen{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  background-size:cover;
  background-position:center;
  display:flex;
  align-items:center;
  justify-content:center;
}

.screen.hidden{ display:none; }

.overlay{
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(10,14,26,.55) 0%, rgba(10,14,26,.75) 55%, rgba(10,14,26,.92) 100%);
}

.panel{
  position:relative;
  z-index:2;
  text-align:center;
  color:var(--cream);
  padding:28px 22px;
  max-width:360px;
}

.panel h1{
  font-size:1.9em;
  margin:0 0 10px;
  color:#ffd77a;
  text-shadow:0 3px 10px rgba(0,0,0,.6);
}

.subtitle{
  font-size:1.05em;
  line-height:1.5;
  margin:0 0 16px;
  color:#f2e9d8;
}

.howto{
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.15);
  border-radius:14px;
  padding:14px 16px;
  margin-bottom:20px;
  text-align:right;
}

.howto-item{
  font-size:.95em;
  padding:6px 0;
  border-bottom:1px dashed rgba(255,255,255,.15);
}
.howto-item:last-child{ border-bottom:none; }

.btn{
  font-family:inherit;
  font-size:1.15em;
  font-weight:700;
  padding:14px 34px;
  border:none;
  border-radius:50px;
  background:linear-gradient(180deg, #f7c85c, #e0a53c);
  color:#3a2405;
  cursor:pointer;
  box-shadow:0 6px 0 #a3701c, 0 10px 18px rgba(0,0,0,.4);
  transition:transform .08s ease;
}
.btn:active{
  transform:translateY(5px);
  box-shadow:0 1px 0 #a3701c, 0 4px 10px rgba(0,0,0,.4);
}

#gameScreen{
  background:#0b0f1a;
  flex-direction:column;
  justify-content:flex-start;
}

#hud{
  position:relative;
  z-index:10;
  width:100%;
  display:flex;
  justify-content:space-between;
  padding:14px 16px 8px;
  color:var(--cream);
  font-weight:700;
  font-size:1.05em;
}

#scoreBox, #bestBox{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  padding:6px 14px;
  border-radius:20px;
}

#gameCanvas{
  display:block;
  width:100%;
  flex:1;
  touch-action:none;
}

#touchControls{
  position:absolute;
  bottom:18px;
  left:0;
  right:0;
  display:flex;
  justify-content:space-between;
  padding:0 24px;
  z-index:20;
  pointer-events:none;
}

.ctrlBtn{
  pointer-events:all;
  width:66px;
  height:66px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.12);
  color:#fff;
  font-size:1.6em;
  backdrop-filter:blur(2px);
  user-select:none;
}
.ctrlBtn:active{ background:rgba(255,255,255,.28); }

@media (min-width:700px){
  #touchControls{ display:none; }
}
