* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 4px;
  color: #222;
}

.subtitle {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* タップエリア */
.tap-area {
  width: 100%;
  height: 220px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
  margin-bottom: 16px;
  -webkit-tap-highlight-color: transparent;
}

.tap-area.waiting {
  background: #e0e0e0;
}

.tap-area.ready {
  background: #e53935;
}

.tap-area.go {
  background: #43a047;
}

.tap-area.penalty {
  background: #fb8c00;
}

.tap-message {
  font-size: 1.6rem;
  font-weight: bold;
  color: #fff;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  padding: 0 16px;
}

.tap-area.waiting .tap-message {
  color: #555;
  text-shadow: none;
}

/* 結果 */
.result-area {
  text-align: center;
  margin-bottom: 16px;
}

.result-area.hidden {
  visibility: hidden;
  height: 36px;
}

.last-time {
  font-size: 1.4rem;
  font-weight: bold;
  color: #1565c0;
}

/* 統計 */
.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-label {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: #222;
}

/* 記録一覧 */
.history-section {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-header h2 {
  font-size: 1rem;
  color: #444;
}

.clear-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: #888;
  cursor: pointer;
}

.clear-btn:hover {
  background: #f5f5f5;
}

.history-list {
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.history-list li:last-child {
  border-bottom: none;
}

.history-rank {
  color: #aaa;
  font-size: 0.8rem;
  width: 28px;
}

.history-time {
  font-weight: bold;
  color: #222;
}

.history-date {
  color: #bbb;
  font-size: 0.75rem;
}

.best-badge {
  color: #f9a825;
  font-size: 0.75rem;
  margin-left: 6px;
}

.empty-msg {
  color: #bbb;
  text-align: center;
  padding: 16px 0;
  font-size: 0.9rem;
}

@media (max-width: 375px) {
  h1 { font-size: 1.3rem; }
  .tap-area { height: 180px; }
  .tap-message { font-size: 1.3rem; }
}
