* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* スマホタップ時の青枠を削除 */
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 15px;
}

.container {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 100%;
  max-width: 360px; /* スマホ・PC両対応幅 */
}

h1 {
  font-size: 22px;
  color: #333;
  margin-top: 0;
  margin-bottom: 16px;
}

/* 数字表示画面 */
.display-screen {
  font-size: 56px;
  font-weight: bold;
  color: #1a73e8;
  height: 110px;
  line-height: 110px;
  background-color: #e8f0fe;
  border-radius: 12px;
  margin-bottom: 20px;
  user-select: none;
  transition: background-color 0.05s ease, color 0.05s ease;
}

/* フラッシュ演出用クラス */
.display-screen.flash {
  background-color: #ffffff !important;
  color: #000000 !important;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.15);
}

.settings, .input-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  font-size: 14px;
  color: #555;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

select, input[type="number"] {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
  outline: none;
}

/* メインボタン */
.main-btn {
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: #1a73e8;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.main-btn:active {
  transform: scale(0.98);
  background-color: #1557b0;
}

/* 画面テンキーレイアウト (Grid) */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 5px;
}

.key-btn {
  padding: 14px 0;
  font-size: 20px;
  font-weight: bold;
  background-color: #f8f9fa;
  color: #333;
  border: 1px solid #dadce0;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s, transform 0.05s;
}

.key-btn:active {
  background-color: #e8eaed;
  transform: scale(0.95);
}

.action-key {
  background-color: #f1f3f4;
  color: #5f6368;
}

/* 結果メッセージ */
.result {
  font-size: 18px;
  font-weight: bold;
  margin-top: 15px;
  min-height: 27px;
}

.correct { color: #2e7d32; }
.incorrect { color: #c62828; }
.hidden { display: none !important; }