/* ============================================================
   GAMES MODULE — games.css
   Light/white theme — matches the main BeCreator app.
   ============================================================ */

/* ---- Full-Screen App Overlay ---- */
#games-app {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #F8F8F6;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Header ---- */
.games-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 50px;
  background: #FFFFFF;
  border-bottom: 1px solid #E8E8E4;
  flex-shrink: 0;
}
.games-back-btn {
  background: none;
  border: none;
  color: #6B6B65;
  font-size: 12px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
  min-width: 80px;
}
.games-back-btn:hover { color: #1A1A18; }
.games-header-title {
  color: #1A1A18;
  font-size: 10px;
  font-family: "Press Start 2P", "Courier New", monospace;
  letter-spacing: 1px;
}
.games-pause-btn {
  background: #F2F2F0;
  border: 1px solid #E0E0DC;
  border-radius: 8px;
  color: #6B6B65;
  font-size: 14px;
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  min-width: 80px;
  justify-content: flex-end;
  background: none;
  border: none;
}
.games-pause-btn:hover { color: #1A1A18; }
.games-pause-btn:active { transform: scale(0.92); }

/* ---- Container ---- */
.games-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #F8F8F6;
}

/* ============================================================
   TETRIS LAYOUT
   ============================================================ */
.tetris-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  height: 100%;
  box-sizing: border-box;
  padding: 10px 16px 12px;
  gap: 8px;
}

/* ---- Score / Stats Strip ---- */
.tetris-score-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid #E8E8E4;
  border-radius: 12px;
  padding: 10px 14px;
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.tetris-score-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.tetris-score-sep {
  width: 1px;
  height: 28px;
  background: #E8E8E4;
  flex-shrink: 0;
}
.tetris-stat-label {
  font-size: 6px;
  color: #B0B0A8;
  letter-spacing: 1.5px;
  font-family: "Press Start 2P", monospace;
}
.tetris-stat-value {
  font-size: 9px;
  color: #1A1A18;
  font-family: "Press Start 2P", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#tetris-next-canvas {
  display: block;
  background: #F8F8F6;
  border: 1px solid #E8E8E4;
  border-radius: 4px;
  image-rendering: pixelated;
}

/* ---- Canvas Wrapper ---- */
.tetris-canvas-wrap {
  position: relative;
  flex-shrink: 0;
  border: 1px solid #E0E0DC;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
  line-height: 0;
  background: #FFFFFF;
}
#tetris-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---- Overlays ---- */
.tetris-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248,248,246,0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.tetris-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 24px;
  text-align: center;
  background: #FFFFFF;
  border: 1px solid #E8E8E4;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  margin: 20px;
}
.tetris-overlay-emoji { font-size: 38px; line-height: 1; margin-bottom: 2px; }
.tetris-overlay-title {
  font-size: 12px;
  color: #1A1A18;
  font-family: "Press Start 2P", monospace;
  letter-spacing: 2px;
}
.tetris-overlay-sub {
  font-size: 7px;
  color: #B0B0A8;
  letter-spacing: 1.5px;
  font-family: "Press Start 2P", monospace;
}
.tetris-overlay-score {
  font-size: 17px;
  color: #1A9B5C;
  font-family: "Press Start 2P", monospace;
}
.tetris-overlay-hint {
  font-size: 6px;
  color: #C0C0B8;
  font-family: "Press Start 2P", monospace;
  margin-top: 4px;
  line-height: 2;
}
.tetris-play-btn {
  background: #1A1A18;
  border: none;
  border-radius: 8px;
  color: #FFFFFF;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  padding: 11px 24px;
  cursor: pointer;
  margin-top: 4px;
  letter-spacing: 1px;
  transition: transform 0.08s, background 0.1s;
}
.tetris-play-btn:hover { background: #2D2D2A; }
.tetris-play-btn:active { transform: scale(0.95); }

/* ---- D-Pad Controls ---- */
.tetris-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 4px;
}
.tetris-dpad-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.tetris-dpad-btn {
  background: #FFFFFF;
  border: 1px solid #E0E0DC;
  border-bottom: 3px solid #D0D0CC;
  border-radius: 10px;
  color: #3A3A38;
  font-size: 16px;
  flex: 1;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.06s, transform 0.06s, border-bottom-width 0.06s;
  font-family: monospace;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.tetris-dpad-btn:active {
  background: #F2F2F0;
  transform: translateY(2px);
  border-bottom-width: 1px;
}
.tetris-dpad-hard {
  background: #F0FFF8;
  border-color: #B8E8D0;
  border-bottom-color: #A0D8C0;
  color: #1A9B5C;
  font-size: 10px;
  font-family: "Press Start 2P", monospace;
  letter-spacing: 0.3px;
}
.tetris-dpad-hard:active {
  background: #E0FFF0;
}
.tetris-dpad-rotate {
  color: #2D6BE4;
  border-color: #C8D8F8;
  border-bottom-color: #B0C8F0;
  background: #F0F4FF;
  font-size: 20px;
}
.tetris-dpad-rotate:active {
  background: #E8EEFF;
}

