* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, #63d2ff 0%, #2f80ed 100%);
  font-family: "Malgun Gothic", "Segoe UI", sans-serif;
  color: #1a1a1a;
}

.game {
  width: 100%;
  max-width: 480px;
  padding: 24px 16px;
  text-align: center;
}

h1 {
  margin: 0 0 14px;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 0 #1b4fb5, 0 0 12px rgba(255, 255, 255, 0.6);
}

.status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.status > div {
  flex: 1;
  padding: 8px 10px;
  border: 3px solid #1a1a1a;
  border-radius: 12px;
  background: #ffd43b;
  box-shadow: 0 4px 0 #1a1a1a;
}

#message {
  min-height: 1.5em;
  margin: 8px 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  font-weight: bold;
}

.board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  padding: 10px;
  margin-bottom: 16px;
  border: 4px solid #1a1a1a;
  border-radius: 16px;
  background: #7b4dff;
  box-shadow: 0 6px 0 #1a1a1a;
}

.cell {
  aspect-ratio: 1 / 1;
  width: 100%;
  padding: 0;
  border: none;
  border-bottom: 4px solid #9aa6c4;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #e9eefc);
  font-size: clamp(0.9rem, 4vw, 1.2rem);
  font-weight: 900;
  color: #1a1a1a;
  cursor: pointer;
}

.cell:hover:not(:disabled) {
  background: linear-gradient(180deg, #fff6a8, #ffd43b);
}

.cell:disabled {
  cursor: default;
}

.cell.found {
  background: linear-gradient(180deg, #8ce99a, #37b24d);
  border-bottom-color: #2b8a3e;
  color: #fff;
}

.cell.miss {
  background: linear-gradient(180deg, #ff8787, #f03e3e);
  border-bottom-color: #c92a2a;
  color: #fff;
}

.cell.reveal {
  border: 3px dashed #1c7ed6;
  background: #d0ebff;
  color: #1c7ed6;
}

#start-btn {
  padding: 12px 32px;
  font-size: 1.15rem;
  font-weight: 900;
  border: 3px solid #1a1a1a;
  border-bottom-width: 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, #69f0ae, #00c853);
  color: #fff;
  text-shadow: 0 2px 0 #1a1a1a;
  cursor: pointer;
}

#start-btn:hover {
  background: linear-gradient(180deg, #8cf7c0, #00d95f);
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 60, 0.75);
  z-index: 10;
}

.overlay[hidden] {
  display: none;
}

.overlay-box {
  width: min(90%, 320px);
  padding: 24px 16px;
  border: 4px solid #1a1a1a;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #dfe9ff);
  box-shadow: 0 8px 0 #1a1a1a;
  text-align: center;
}

.overlay-box h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #7b4dff;
}

.overlay-box p {
  margin: 6px 0;
  font-weight: bold;
}

#result-restart-btn {
  margin-top: 12px;
  padding: 12px 32px;
  font-size: 1.15rem;
  font-weight: 900;
  border: 3px solid #1a1a1a;
  border-bottom-width: 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, #69f0ae, #00c853);
  color: #fff;
  text-shadow: 0 2px 0 #1a1a1a;
  cursor: pointer;
}

#result-restart-btn:hover {
  background: linear-gradient(180deg, #8cf7c0, #00d95f);
}
