/* Import Google font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0f172a;
}

.wrapper {
  width: 90vmin;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 16px;
  background: #1e293b;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
  padding: 15px;
  border: 1px solid #334155;
}

.game-details {
  color: #f8fafc;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  background: #0f172a;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid #334155;
}

.play-board {
  height: 70vmin;
  max-height: 380px;
  width: 100%;
  display: grid;
  background: #090d16;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 3.33% 3.33%;
  grid-template: repeat(30, 1fr) / repeat(30, 1fr);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
  border: 2px solid #3b82f6;
}

/* Tampilan Makanan */
.play-board .food {
  background: radial-gradient(circle, #ff4d4d 0%, #cc0000 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px #ff4d4d, 0 0 20px #ff0000;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(0.85); }
  100% { transform: scale(1.05); }
}

/* Tampilan Kepala Ular */
.play-board .snake-head {
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
  position: relative;
  z-index: 2;
}

/* Mata Ular pada Kepala */
.play-board .snake-head::after {
  content: '';
  position: absolute;
  top: 30%;
  right: 25%;
  width: 4px;
  height: 4px;
  background-color: #000;
  border-radius: 50%;
}

/* Tampilan Badan Ular */
.play-board .snake-body {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  border-radius: 4px;
  opacity: 0.9;
}

/* Analog / D-Pad Section */
.controls-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
}

.dpad {
  position: relative;
  width: 130px;
  height: 130px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  background: #0f172a;
  border-radius: 50%;
  padding: 8px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 4px 10px rgba(0,0,0,0.3);
  border: 2px solid #334155;
}

.dpad-btn {
  background: #1e293b;
  border: 1px solid #475569;
  color: #38bdf8;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.1s ease;
  user-select: none;
}

.dpad-btn:active {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 0 10px #38bdf8;
}

.dpad-btn.up {
  grid-column: 2;
  grid-row: 1;
  border-radius: 8px 8px 0 0;
}

.dpad-btn.left {
  grid-column: 1;
  grid-row: 2;
  border-radius: 8px 0 0 8px;
}

.dpad-center {
  grid-column: 2;
  grid-row: 2;
  background: #0f172a;
}

.dpad-btn.right {
  grid-column: 3;
  grid-row: 2;
  border-radius: 0 8px 8px 0;
}

.dpad-btn.down {
  grid-column: 2;
  grid-row: 3;
  border-radius: 0 0 8px 8px;
}