/* ===== リセット・ベース ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  background: #f0f4ff;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* ===== アプリ全体 ===== */
.app {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== ヘッダー ===== */
.header {
  background: #4a90d9;
  color: #fff;
  text-align: center;
  padding: 18px 20px;
}

.header h1 {
  font-size: 1.15rem;
  font-weight: bold;
  letter-spacing: 2px;
}

/* ===== カウント表示 ===== */
.display-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.count {
  font-size: 7rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #2c3e50;
  transition: transform 0.1s, color 0.2s;
  user-select: none;
}

.count.bump {
  transform: scale(1.15);
}

/* 正の数は青・負の数は赤 */
.count.positive { color: #4a90d9; }
.count.negative { color: #e74c3c; }
.count.zero     { color: #2c3e50; }

/* ===== 操作ボタン ===== */
.controls {
  display: flex;
  gap: 16px;
  padding: 0 24px 32px;
  justify-content: center;
  align-items: center;
}

.btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.1s, box-shadow 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.92);
  box-shadow: none;
}

/* ＋ ／ － ボタン（大） */
.btn-plus,
.btn-minus {
  width: 88px;
  height: 88px;
  font-size: 2.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-plus {
  background: #4a90d9;
  color: #fff;
}

.btn-minus {
  background: #e74c3c;
  color: #fff;
}

/* リセットボタン（小） */
.btn-reset {
  width: 60px;
  height: 60px;
  font-size: 0.75rem;
  background: #ecf0f1;
  color: #888;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ===== 履歴エリア ===== */
.history-area {
  padding: 0 24px 40px;
}

.history-label {
  font-size: 0.78rem;
  color: #aaa;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.history-item {
  font-size: 0.88rem;
  color: #666;
  padding: 4px 8px;
  background: #fff;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
}

.history-item .h-op   { font-weight: bold; }
.history-item .h-plus  { color: #4a90d9; }
.history-item .h-minus { color: #e74c3c; }
.history-item .h-reset { color: #aaa; }
.history-item .h-val  { color: #999; }

/* ===== スマホ調整 ===== */
@media (max-width: 375px) {
  .count {
    font-size: 5.5rem;
  }

  .btn-plus,
  .btn-minus {
    width: 76px;
    height: 76px;
    font-size: 2rem;
  }

  .btn-reset {
    width: 52px;
    height: 52px;
  }
}
