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

html, body {
  height: 100%;
  background: #0b0b14;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
}

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  background: #0b0b14;
}

/* ---------- Controale touch ---------- */
#touch-ui { display: none; }

body.touch #touch-ui {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.tzone {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.tzone-left  { left: max(12px, env(safe-area-inset-left)); }
.tzone-right { right: max(12px, env(safe-area-inset-right)); flex-wrap: wrap; width: 132px; justify-content: flex-end; }

.tbtn {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}

.tbtn:active { background: rgba(255,255,255,.35); transform: scale(.94); }

.tbtn-p { border-color: rgba(255,90,90,.7); }
.tbtn-k { border-color: rgba(90,160,255,.7); }
.tbtn-b { border-color: rgba(200,200,200,.7); }
.tbtn-s { border-color: rgba(255,190,40,.9); background: rgba(255,190,40,.15); }

/* ---------- Sugestie rotire (doar telefon portret) ---------- */
#rotate-hint { display: none; }

@media (max-width: 900px) and (orientation: portrait) {
  body.touch #rotate-hint {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 30;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(11, 11, 20, .96);
    color: #fff;
    text-align: center;
    padding: 24px;
  }
  body.touch #touch-ui { display: none; }
}

.rot-emoji { font-size: 64px; animation: rotwig 1.6s ease-in-out infinite; }
.rot-title { font-size: 24px; font-weight: 900; color: #ffd020; }
.rot-sub { font-size: 15px; color: #cfcfe0; max-width: 240px; font-family: Arial, sans-serif; font-weight: normal; }

@keyframes rotwig {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(12deg); }
}

#mute-btn {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
