:root {
  --sidebar-bg: #4a4a4a;
  --text-color: #e0e0e0;
}

* {
  box-sizing: border-box;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

body {
  margin: 0;
  padding: 0;
  background-color: #111;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

#game-container {
  display: flex;
  flex-direction: row;
  height: 600px;
  background-color: #000;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  position: relative;
  border: 2px solid #333;
  border-radius: 4px;
  overflow: hidden;
}

/* --- Canvas --- */
#tris-canvas {
  background-color: #1a1a1a;
  background-image: linear-gradient(#252525 1px, transparent 1px),
    linear-gradient(90deg, #252525 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: 0 0;
  width: 300px;
  height: 600px;
  display: block;
  flex-shrink: 0;
}

/* --- Sidebar --- */
.sidebar {
  width: 30%;
  background: linear-gradient(
    90deg,
    #333 0%,
    #666 15%,
    #888 40%,
    #666 60%,
    #333 100%
  );
  border-left: 2px solid #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  color: #ccc;
  box-shadow: inset 5px 0 15px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.title {
  font-size: 28px;
  margin-top: 20px;
  margin-bottom: 20px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 300;
  text-shadow: -1px -1px 1px rgba(255, 255, 255, 0.3),
    1px 1px 2px rgba(0, 0, 0, 0.8);
}

.ui-group {
  width: 100%;
  margin-bottom: 15px;
  text-align: center;
}

.ui-group label {
  display: block;
  font-size: 9px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #333;
  text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.display-box {
  background-color: #555;
  width: 90%;
  margin: 0 auto;
  padding: 8px 0;
  border-radius: 6px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.6),
    inset -1px -1px 2px rgba(255, 255, 255, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid #333;
}

.next-piece-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.next-piece-box {
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Menu Button --- */
#menu-btn {
  margin-top: auto;
  margin-bottom: 20px;
  width: 90%;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid #333;
  background: linear-gradient(180deg, #777 0%, #444 100%);
  color: #ddd;
  font-weight: bold;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}

#menu-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}

/* --- Game Over Overlay --- */
.hidden {
  display: none !important;
}

#game-over-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 100;
}

#game-over-overlay h2 {
  font-size: 36px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px #ff0000;
}

#restart-btn {
  margin-top: 20px;
  padding: 15px 30px;
  font-size: 18px;
  background: linear-gradient(#4caf50, #2e7d32);
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  pointer-events: auto;
}

/* --- Pause Overlay --- */
#pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 100;
}

#pause-overlay h2 {
  font-size: 36px;
  margin-bottom: 30px;
  text-shadow: 0 0 10px #ffffff;
}

#resume-btn,
#pause-restart-btn {
  margin: 10px 0;
  padding: 15px 40px;
  font-size: 18px;
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  width: 180px;
}

#resume-btn {
  background: linear-gradient(#4caf50, #2e7d32);
}

#pause-restart-btn {
  background: linear-gradient(#f44336, #c62828);
}
