:root {
  --bg-color: #0f172a;
  --panel-bg: rgba(30, 41, 59, 0.7);
  --tile-bg: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --tile-text: #ffffff;
  --accent-color: #10b981;
  --empty-bg: #1e293b;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: #f8fafc;
  font-family: var(--font-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

#wrapper {
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 500px;
  width: 90%;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#rules p {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* Table Styling */
table {
  border-collapse: separate;
  border-spacing: 10px;
  margin: 1.5rem auto;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 16px;
}

.tile {
  width: 80px;
  height: 80px;
  background: var(--tile-bg);
  color: var(--tile-text);
  font-size: 1.8rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.tile:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

.tile:active {
  transform: scale(0.95);
}

.blank {
  width: 80px;
  height: 80px;
  background: var(--empty-bg);
  border-radius: 12px;
}

/* Controls Styling */
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

input[type="text"] {
  background: #334155;
  border: 1px solid #475569;
  color: white;
  padding: 0.5rem;
  border-radius: 8px;
  width: 50px;
  text-align: center;
}

#newGame {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#newGame:hover {
  background: #059669;
}

/* Stats Styling */
.stats-container {
  display: flex;
  justify-content: space-around;
  margin-top: 2rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 12px;
}

#run, .tex {
  font-size: 0.9rem;
  color: #cbd5e1;
  font-weight: 500;
}

#moves, #tim {
  color: #60a5fa;
  font-weight: 800;
  font-size: 1.1rem;
}