/* ========== 基本設定 ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #e0e0e0;
  font-family: 'Segoe UI', sans-serif;
}

/* ========== 中央コンテナ ========== */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 36px 46px 36px;
  width: 320px;
  max-width: 94vw;
  border-radius: 30px;
  background: #e0e0e0;
  box-shadow: inset 10px 10px 30px #9e9e9e,
    inset -10px -10px 30px #ffffff,
    3px 3px 9px rgba(0, 0, 0, 0.1);
}

.left-side,
.right-side {
  width: 94vw;
  max-width: 320px;
  padding: 0 30px 0 32px;
}

/* ========== 時間表示 ========== */
#time {
  width: 100%;
  font-size: 52px;
  text-align: center;
  color: #333;
  padding: 2px 0 6px;
  margin-bottom: 24px;
  background: #e0e0e0;
  box-shadow: inset 4px 4px 8px #bebebe,
    inset -4px -4px 8px #ffffff;
  transition: all 0.3s ease;
}

.time-colon {
  display: inline-block;
  transform: translateY(-5px);
}

/* ========== プリセットボタン ========== */
.preset-buttons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  margin-bottom: 16px;
}

.preset-buttons button {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 12px;
  border: none;
  background: #f0f0f0;
  color: #333;
  box-shadow: inset -5px -5px 10px #a3a3a3,
    inset 5px 5px 10px #ffffff;
  cursor: pointer;
  transition: 0.2s;
}

.preset-buttons button:active {
  background: #e0e0e0;
  box-shadow: -5px -5px 10px #9e9e9e,
    5px 5px 10px #ffffff;
}

/* ========== 数字ボタンエリア ========== */
.digit-buttons {
  display: grid;
  justify-items: center;
  align-items: center;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 8px;
  width: 100%;
}

.digit-buttons button {
  width: 100%;
  aspect-ratio: 1/0.5;
  font-size: 18px;
  font-weight: bold;
  border-radius: 12px;
  border: none;
  background: #f0f0f0;
  color: #333;
  cursor: pointer;
  box-shadow: inset -6px -6px 12px #a3a3a3,
    inset 6px 6px 12px #ffffff;
  transition: all 0.2s ease;
}

.digit-buttons button:active {
  background: #e0e0e0;
  box-shadow: -6px -6px 12px #9e9e9e,
    6px 6px 12px #ffffff;
}

/* ========== 特別ボタン（スタート・リセット） ========== */
.digit-buttons button:nth-child(10) {
  /* スタート */
  font-size: 12px;
  background: #e3edf7;
}

.digit-buttons button:nth-child(12) {
  /* リセット */
  font-size: 12px;
  background: #f2e3e7;
}

/* ========== ボタン無効時のグレーアウト表示 ========== */
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========== アラームヒント ========== */
#stopHint {
  font-size: 12px;
  color: #666;
  margin-top: 10px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  height: 1em;
  text-align: center;
}

#stopHint.show {
  visibility: visible;
  opacity: 1;
}

/* 横向き：左右並びレイアウトに切り替え */
@media screen and (max-width: 767px) and (orientation: landscape) {
  .container {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 90%;
    max-width: 94vw;
    padding: 40px 40px 38px 42px;
    gap: 40px;
  }

  .left-side,
  .right-side {
    flex: 1;
    width: auto;
    max-width: 240px;
    padding: 0;
  }

  .left-side>*,
  .right-side>* {
    width: 100%;
  }

.preset-buttons {
  margin-bottom: 0;
}

  .digit-buttons {
    width: 100%;
    max-width: 240px;
  }
}

