.tetris-top-right-trigger {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  background: linear-gradient(135deg, #ff7a18, #af002d 70%);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.tetris-top-right-trigger:hover,
.tetris-top-right-trigger:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.tetris-modal[hidden] {
  display: none !important;
}

.tetris-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
}

.tetris-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.tetris-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(92vw, 420px);
  margin: 6vh auto;
  background: #10131f;
  color: #fff;
  border-radius: 18px;
  padding: 20px 20px 24px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
}

.tetris-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.tetris-modal__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#tetris-canvas {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  background: #050816;
  border: 2px solid rgba(255,255,255,0.15);
}

.tetris-panel {
  text-align: center;
}

.tetris-help {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.78);
}

body.tetris-modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .tetris-top-right-trigger {
    top: 14px;
    right: 14px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .tetris-modal__dialog {
    width: min(94vw, 380px);
    margin: 4vh auto;
    padding: 18px 16px 20px;
  }
}
