body {
  font-family: Arial, "Noto Sans JP", sans-serif;
  margin: 0;
  padding: 8px;
  text-align: center;
  background: linear-gradient(to bottom, #f5f7fa, #e4e8ee);
}

/* 🔥 FIX: single screen layout */
html, body {
  height: 100%;
  overflow: hidden;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* 🔥 FIX */
  gap: 8px; /* spacing control */
}

/* TITLE */
.title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-logo {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  margin-bottom: 5px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

.game-title {
  font-size: 24px;
  font-weight: bold;
  background: linear-gradient(45deg, #ff7a18, #ffb347, #6dd5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  gap: 6px;
}

.game-title .kanji {
  font-size: 18px;
  color: #444;
  -webkit-text-fill-color: #444;
}

/* TOP */
.top-bar {
  display: flex;
  justify-content: space-between;
  width: 260px;
  margin: 5px 0;
  font-weight: bold;
}

/* BOARD */
#board {
  display: grid;
  grid-template-columns: repeat(9, 38px);
  grid-template-rows: repeat(9, 38px);
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
  background: #dcdcdc;
}

/* CELLS */
.cell {
  width: 38px;
  height: 38px;
  line-height: 38px;
  font-size: 18px;
  border: 1px solid #888;
  background: #fff;
  color: #000;
  cursor: pointer;
  user-select: none;
  transition: 0.15s;
}

.cell:active {
  transform: scale(0.9);
}

.fixed { background: #e0e0e0; font-weight: bold; }
.selected { background: #cde7ff !important; }
.same-value { background: #eef6ff; }
.conflict { background: #ffcccc; }

/* CONTROLS */
.controls {
  margin: 5px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* SYMBOL MEANING */
#symbol-meaning {
  font-size: 14px;
  color: #444;
  margin-top: 6px;
  height: 20px;
  font-weight: 500;
}
/* KEYPAD */
#numpad {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  justify-content: center;
  margin-bottom: 8px;
}

.num-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: white;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

.num-btn:active {
  transform: scale(0.9);
}

/* COLORS */
.num-btn:nth-child(1){background:#4facfe;}
.num-btn:nth-child(2){background:#43e97b;}
.num-btn:nth-child(3){background:#fa709a;}
.num-btn:nth-child(4){background:#a18cd1;}
.num-btn:nth-child(5){background:#00c9ff;}
.num-btn:nth-child(6){background:#f7971e;}
.num-btn:nth-child(7){background:#ff6a88;}
.num-btn:nth-child(8){background:#667eea;}
.num-btn:nth-child(9){background:#f5576c;}
.num-btn:last-child{background:#333;}

/* AD */
#ad-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  z-index: 999;
  display: none;
}

#ad-overlay.show {
  display: flex;
}

.hidden {
  display: none;
}
