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

html, body {
  width: 100%;
  height: 100%;
  background: #0C0D14;
  font-family: 'Courier New', monospace;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  max-width: 480px;
  width: 100%;
  height: 100vh;
  max-height: 700px;
}

/* -- Header -------------------------------------------------- */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #00ff88;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.scores {
  display: flex;
  gap: 10px;
}

.score-box {
  background: #1a1b26;
  border: 1px solid #2a2b3a;
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
}

.score-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
}

.score-value {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

/* -- Stats Row ----------------------------------------------- */

.stats-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
}

.stat {
  font-size: 13px;
  color: #888;
  letter-spacing: 0.5px;
}

/* -- Canvas -------------------------------------------------- */

#canvas {
  width: 100%;
  flex: 1;
  background: #1a1b26;
  border-radius: 10px;
  border: 1px solid #2a2b3a;
  display: block;
}

/* -- Input --------------------------------------------------- */

.input-row {
  width: 100%;
}

#input {
  width: 100%;
  padding: 12px 16px;
  background: #1a1b26;
  border: 2px solid #2a2b3a;
  border-radius: 8px;
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 1px;
}

#input:focus {
  border-color: #00ff88;
}

#input::placeholder {
  color: #555;
}

/* -- Overlay ------------------------------------------------- */

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(12, 13, 20, 0.88);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  display: none;
}

.overlay-box {
  text-align: center;
  padding: 40px 48px;
  background: #161822;
  border: 2px solid #2a2d3a;
  border-radius: 12px;
}

.overlay-box h1 {
  font-size: 32px;
  margin-bottom: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #00ff88;
}

.overlay-box p {
  font-size: 16px;
  margin-bottom: 8px;
  color: #ccc;
}

.overlay-box span {
  color: #ffcc00;
  font-weight: 700;
}

.action-hint {
  font-size: 14px !important;
  color: #777 !important;
  margin-top: 12px !important;
  animation: pulse 2s infinite;
}

.hidden {
  display: none !important;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* -- Responsive ---------------------------------------------- */

@media (max-width: 420px) {
  .container {
    padding: 10px;
    gap: 8px;
  }
  .title {
    font-size: 20px;
  }
  #input {
    font-size: 16px;
    padding: 10px 12px;
  }
}
