* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  background: radial-gradient(circle at center, #1b263b 0%, #0d1b2a 100%);
  color: #e0e1dd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
}

header {
  text-align: center;
  margin-bottom: 12px;
}

header h1 {
  font-size: 1.4rem;
  color: #00f2fe;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
  letter-spacing: 1px;
}

.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 10px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a8dadc;
}

#game-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 420px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(0, 242, 254, 0.3);
  aspect-ratio: 3 / 4;
}

#game-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 27, 42, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  transition: opacity 0.4s ease;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(0, 242, 254, 0.2);
  border-top-color: #00f2fe;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Controls Area */
.controls-container {
  width: 100%;
  max-width: 420px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.softkeys-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.btn-soft {
  flex: 1;
  padding: 10px;
  background: linear-gradient(135deg, #1f4068, #162447);
  color: #fff;
  border: 1px solid #00f2fe44;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  touch-action: manipulation;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-key {
  height: 46px;
  background: rgba(255, 255, 255, 0.06);
  color: #f1faee;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all 0.08s ease;
}

.btn-key small {
  font-size: 0.55rem;
  color: #8d99ae;
  margin-top: -2px;
}

.btn-key:active, .btn-soft:active {
  background: #00f2fe;
  color: #000;
  transform: scale(0.96);
}

.btn-dpad {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.3);
}

.btn-ok {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: #fff;
}
