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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: white;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* Game container and background */
.game-container {
  min-height: 100vh;
  background: linear-gradient(to bottom, #111827, #4b0082, #111827);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  position: relative;
}

.background-pattern {
  position: absolute;
  inset: 0;
  background-image: url('game.images/geometric-abstraction.png');
  opacity: 0.1;
  background-repeat: repeat;
}

.background-effects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.bg-effect-1 {
  position: absolute;
  top: 25%;
  left: 25%;
  width: 50%;
  height: 50%;
  background-color: #a855f7;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.2;
  animation: pulse 4s infinite;
}

.bg-effect-2 {
  position: absolute;
  top: 33%;
  right: 25%;
  width: 33%;
  height: 33%;
  background-color: #06b6d4;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.1;
  animation: pulse 4s infinite 1s;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.3;
  }
}

.game-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
}

/* Game title */
.game-title {
  text-align: center;
  margin-bottom: 2rem;
}

.game-title h1 {
  font-size: 3rem;
  font-weight: bold;
  background: linear-gradient(to right, #a78bfa, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .game-title h1 {
    font-size: 4.5rem;
  }
}

.game-title p {
  color: #c4b5fd;
  font-size: 1.125rem;
}

/* Screens */
.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Welcome screen */
.welcome-box {

  backdrop-filter: blur(8px);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
  width: 100%;
  max-width: 28rem;
  margin-bottom: 2rem;
  text-align: center;
}






/* Game over screen */
.game-over-box {
  background-color: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(8px);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
  width: 100%;
  max-width: 28rem;
  text-align: center;
}

.game-over-box h2 {
  font-size: 1.875rem;
  font-weight: bold;
  color: white;
  margin-bottom: 0.5rem;
}

.final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: rgba(31, 41, 55, 0.5);
  border-radius: 0.5rem;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.score-label {
  color: #9ca3af;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.score-value {
  font-size: 2.25rem;
  font-weight: bold;
  background: linear-gradient(to right, #a78bfa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
  text-align: center;
}

.stat-label {
  color: #9ca3af;
  font-size: 0.75rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: white;
}

/* Game screen */
.game-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .game-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* Board container */
.board-container {
  position: relative;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Game board */
.game-board {
  position: relative;
  background-color: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(8px);
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.board-grid-lines {
  position: absolute;
  inset: 1rem;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(20, 1fr);
  gap: 1px;
  pointer-events: none;
}

.board-grid-lines::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(31, 41, 55, 0.3);
  z-index: -1;
}

.board-cells {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1px;
  background-color: rgba(31, 41, 55, 0.5);
  padding: 1px;
  border-radius: 0.5rem;
}

.cell {
  width: 28px;
  height: 28px;
  border-radius: 0.125rem;
  transition: background-color 0.1s;
  background-color: rgba(17, 24, 39, 0.8);
}

@media (min-width: 768px) {
  .cell {
    width: 32px;
    height: 32px;
  }
}

.cell.empty {
  background-color: rgba(17, 24, 39, 0.8);
}

.cell.ghost {
  background-color: rgba(107, 114, 128, 0.2);
  border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Tetromino colors */
.cell.I {
  background: linear-gradient(to bottom right, #22d3ee, #0891b2);
  border: 1px solid #67e8f9;
  box-shadow: 0 0 5px rgba(6, 182, 212, 0.3);
}

.cell.J {
  background: linear-gradient(to bottom right, #60a5fa, #2563eb);
  border: 1px solid #93c5fd;
  box-shadow: 0 0 5px rgba(37, 99, 235, 0.3);
}

.cell.L {
  background: linear-gradient(to bottom right, #fb923c, #ea580c);
  border: 1px solid #fdba74;
  box-shadow: 0 0 5px rgba(234, 88, 12, 0.3);
}

.cell.O {
  background: linear-gradient(to bottom right, #facc15, #ca8a04);
  border: 1px solid #fde047;
  box-shadow: 0 0 5px rgba(202, 138, 4, 0.3);
}

.cell.S {
  background: linear-gradient(to bottom right, #4ade80, #16a34a);
  border: 1px solid #86efac;
  box-shadow: 0 0 5px rgba(22, 163, 74, 0.3);
}

.cell.T {
  background: linear-gradient(to bottom right, #c084fc, #9333ea);
  border: 1px solid #d8b4fe;
  box-shadow: 0 0 5px rgba(147, 51, 234, 0.3);
}

.cell.Z {
  background: linear-gradient(to bottom right, #f87171, #dc2626);
  border: 1px solid #fca5a5;
  box-shadow: 0 0 5px rgba(220, 38, 38, 0.3);
}

/* Line clear animation */
@keyframes line-clear {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.5);
    background-color: white;
    border-color: white;
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.cell.clearing {
  animation: line-clear 0.4s ease-in-out;
}

/* Pause overlay */
.pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  border-radius: 0.75rem;
  z-index: 10;
}

.pause-content {
  text-align: center;
  padding: 1.5rem;
}

.pause-content p {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  margin-bottom: 1rem;
}

/* Next piece preview */
.next-piece-preview {
  background-color: rgba(31, 41, 55, 0.8);
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.preview-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
  text-align: center;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background-color: rgba(17, 24, 39, 0.5);
  padding: 1px;
  border-radius: 0.25rem;
}

.preview-cell {
  width: 16px;
  height: 16px;
  border-radius: 0.125rem;
  background-color: rgba(17, 24, 39, 0.8);
}

/* Side panel */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 1024px) {
  .side-panel {
    width: auto;
  }
}

/* Score panel */
.score-panel, .controls-panel {
  background-color: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 0.75rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
  color: white;
  width: 100%;
}

.panel-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.panel-header h3 {
  text-align: center;
  background: linear-gradient(to right, #a78bfa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.125rem;
  font-weight: bold;
}

.panel-content {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

/* Stat rows */
.stat-row, .control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(31, 41, 55, 0.5);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.stat-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
}

.trophy-icon {
  background-color: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.level-icon {
  background-color: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
}

.lines-icon {
  background-color: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

.stat-row span:nth-child(2) {
  color: #d1d5db;
  margin-right: auto;
}

.stat-row .stat-value {
  font-size: 1.25rem;
  font-weight: bold;
}

/* Control rows */
.control-row {
  padding: 0.5rem;
  font-size: 0.875rem;
}

.control-key {
  width: 1.75rem;
  height: 1.75rem;
  background-color: #374151;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  color: #c084fc;
}

.control-row span:nth-child(2) {
  color: #d1d5db;
  margin-right: auto;
}

.key-label {
  font-weight: 500;
}

/* Buttons */
.primary-button {
  width: 100%;
  background: linear-gradient(to right, #9333ea, #0891b2);
  color: white;
  font-weight: bold;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
  transition: all 0.2s;
}

.primary-button:hover {
  background: linear-gradient(to right, #7e22ce, #0e7490);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.7);
}

.icon-button {
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(168, 85, 247, 0.5);
  background-color: #1f2937;
  color: #c084fc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.icon-button:hover {
  background-color: #374151;
}

/* Next piece preview - Updated */
.next-piece-preview {
  background-color: rgba(31, 41, 55, 0.8);
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.preview-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
  text-align: center;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background-color: rgba(17, 24, 39, 0.5);
  padding: 1px;
  border-radius: 0.25rem;
}

.preview-cell {
  width: 18px;
  height: 18px;
  border-radius: 0.125rem;
  background-color: rgba(17, 24, 39, 0.8);
}

/* Tetromino colors for preview cells */
.preview-cell.I {
  background: linear-gradient(to bottom right, #22d3ee, #0891b2);
  border: 1px solid #67e8f9;
  box-shadow: 0 0 5px rgba(6, 182, 212, 0.3);
}

.preview-cell.J {
  background: linear-gradient(to bottom right, #60a5fa, #2563eb);
  border: 1px solid #93c5fd;
  box-shadow: 0 0 5px rgba(37, 99, 235, 0.3);
}

.preview-cell.L {
  background: linear-gradient(to bottom right, #fb923c, #ea580c);
  border: 1px solid #fdba74;
  box-shadow: 0 0 5px rgba(234, 88, 12, 0.3);
}

.preview-cell.O {
  background: linear-gradient(to bottom right, #facc15, #ca8a04);
  border: 1px solid #fde047;
  box-shadow: 0 0 5px rgba(202, 138, 4, 0.3);
}

.preview-cell.S {
  background: linear-gradient(to bottom right, #4ade80, #16a34a);
  border: 1px solid #86efac;
  box-shadow: 0 0 5px rgba(22, 163, 74, 0.3);
}

.preview-cell.T {
  background: linear-gradient(to bottom right, #c084fc, #9333ea);
  border: 1px solid #d8b4fe;
  box-shadow: 0 0 5px rgba(147, 51, 234, 0.3);
}

.preview-cell.Z {
  background: linear-gradient(to bottom right, #f87171, #dc2626);
  border: 1px solid #fca5a5;
  box-shadow: 0 0 5px rgba(220, 38, 38, 0.3);
}


