* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  min-height: 100vh;
  background: #1a1a2e;
  color: #fff;
}

.hidden {
  display: none !important;
}

/* 接続画面 */
.connect-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
}

.connect-screen h2 {
  margin-bottom: 30px;
  font-size: 1.5rem;
}

.room-id {
  font-size: 2.5rem;
  font-weight: bold;
  letter-spacing: 4px;
  background: #2a2a4a;
  padding: 20px 40px;
  border-radius: 8px;
  margin: 10px 0 20px;
}

.connect-screen input {
  font-size: 1.5rem;
  padding: 15px 20px;
  border: none;
  border-radius: 8px;
  text-align: center;
  width: 100%;
  max-width: 300px;
  margin-bottom: 15px;
}

.connect-screen button {
  font-size: 1.2rem;
  padding: 15px 40px;
  border: none;
  border-radius: 8px;
  background: #4a4aff;
  color: #fff;
  cursor: pointer;
}

.connect-screen button:hover {
  background: #6a6aff;
}

.status {
  margin-top: 20px;
  color: #888;
}

/* 演台側タイマー表示 */
.timer-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  transition: background-color 0.3s;
}

.time-display {
  font-size: 30vw;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2vw;
}

/* 背景色の状態 */
.display-mode.normal {
  background: #1a1a2e;
}

.display-mode.warning {
  background: #b8860b;
}

.display-mode.danger {
  background: #c0392b;
}

.display-mode.finished {
  background: #c0392b;
  animation: blink 0.5s infinite;
}

@keyframes blink {
  50% {
    opacity: 0.7;
  }
}

/* 操作画面 */
.controller-screen {
  padding: 20px;
  max-width: 400px;
  margin: 0 auto;
}

.time-preview {
  font-size: 4rem;
  font-weight: bold;
  text-align: center;
  padding: 30px;
  background: #2a2a4a;
  border-radius: 12px;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

.section {
  margin-bottom: 20px;
}

.section p {
  margin: 0 0 10px;
  color: #888;
  font-size: 0.9rem;
}

.preset-buttons,
.adjust-buttons,
.control-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-buttons button,
.adjust-buttons button {
  flex: 1;
  min-width: 60px;
  padding: 15px 10px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #3a3a5a;
  color: #fff;
  cursor: pointer;
}

.preset-buttons button:hover,
.adjust-buttons button:hover {
  background: #4a4a7a;
}

.control-buttons button {
  flex: 1;
  padding: 20px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.control-buttons .primary {
  background: #27ae60;
  color: #fff;
}

.control-buttons .warning {
  background: #f39c12;
  color: #fff;
}

.control-buttons .danger {
  background: #c0392b;
  color: #fff;
}

.control-buttons button:hover {
  opacity: 0.9;
}

.connection-status {
  text-align: center;
  color: #666;
  font-size: 0.85rem;
  margin-top: 30px;
}

/* ルーム情報表示 */
.room-info {
  text-align: center;
  margin-bottom: 20px;
  padding: 15px;
  background: #2a2a4a;
  border-radius: 8px;
}

.room-info p {
  margin: 0 0 5px;
  color: #888;
  font-size: 0.9rem;
}

.room-id-box {
  font-size: 1.8rem;
  font-weight: bold;
  letter-spacing: 3px;
  color: #4a4aff;
}

.viewer-count {
  margin-top: 10px !important;
  font-size: 0.85rem !important;
}
