body {
  -webkit-touch-callout: none !important;
}
a {
  user-select: none !important;
  -webkit-user-select: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #111;
  color: #fff;
  /* height: 100%; */
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

#waiting-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
  text-align: center;
}

#waiting-screen h3 {
  font-size: 1.5em;
  margin-bottom: 20px;
}

#waiting-screen h1 {
  font-size: 3em;
  margin-bottom: 4px;
}

#waiting-screen p {
  font-size: 1.2em;
  color: #aaa;
  margin: 10px 0;
}

/* Warning and note styles */
#waiting-screen .warning-text {
  color: #ff6b6b;
  font-weight: 600;
  font-size: 1.3em;
  margin-top: 25px;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

#waiting-screen .note-text {
  color: #aaa;
  font-size: 1.1em;
  margin: 10px 0 20px;
}

#waiting-screen .position {
  font-size: 2em;
  color: #fff;
  margin: 20px 0;
}

.game-info {
  text-align: center;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.95);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #333;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.info-item {
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #444;
}

.info-value {
  font-size: 1.4em;
  font-weight: bold;
  margin-top: 5px;
}

.info-level {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 5px;
}

.next-piece-preview {
  background: rgba(0, 0, 0, 0.95);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #333;
  text-align: center;
}

.next-piece-preview h3 {
  margin-bottom: 10px;
  color: #fff;
}

canvas.next-piece {
  border: 1px solid #333;
  background: #111;
}

.controls {
  width: 100%;
  padding: 16px;
  background: rgba(0, 0, 0, 0.9);
  border-top: 1px solid #333;
  transition: opacity 0.3s ease;
}

.keyboard-controls {
  display: none;
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
}

.container {
  padding: 16px 0px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 80px;
}

.btn {
  background: #222;
  border: none;
  color: #fff;
  padding: 25px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  transition: all 0.2s;
  border: 1px solid #444;
}

.btn:active {
  background: #333;
  transform: scale(0.95);
}

.btn-left {
  grid-column: 1;
  grid-row: span 2;
}
.btn-right {
  grid-column: 3;
  grid-row: span 2;
}
.btn-down {
  grid-column: 2;
  grid-row: 2;
}
.btn-rotate {
  grid-column: 2;
  grid-row: 1;
}

@media (min-width: 768px) {
  .keyboard-controls {
    display: block;
  }
  .keyboard-controls h2 {
    margin-bottom: 10px;
  }
  .keyboard-controls ul {
    list-style: none;
  }
  .keyboard-controls li {
    margin: 5px 0;
  }
  .buttons {
    display: none;
  }
}

@media (max-height: 600px) {
  .btn {
    padding: 15px;
  }
  .game-info {
    padding: 10px;
  }
}

.hidden {
  display: none !important;
}

.game-elements {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;

  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
}

.game-elements.visible {
  opacity: 1;
  pointer-events: auto;
  height: 100vh;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
}

.canvas-block {
  padding: 20px 0px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 20px;
  text-align: center;
}

.modal-content {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #444;
}

.modal-content p {
  margin-bottom: 8px;
}

.modal-content h2 {
  margin-bottom: 16px;
}

.menu-button {
  background: #222;
  border: none;
  color: #fff;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 20px;
}

.buttons {
  grid-template-rows: auto auto;
}

#language-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  background-color: rgba(0, 243, 255, 0.15);
  border-radius: 30px;
  color: #5cffc0;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 1rem;
  z-index: 3001;
  backdrop-filter: blur(8px);
  letter-spacing: 1px;
  border: none;
}

#language-switcher:hover {
  background-color: rgba(0, 243, 255, 0.25);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}
