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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  background: #f5f5f5;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #1a1a1a;
}

.app-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-right {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

/* Clock Panel */
.clock-panel {
  background: #1a1a1a;
  border-radius: 0 0 24px 24px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.clock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 8px;
}

.date-display {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.session-counter {
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

/* Clock Display Area */
.clock-display-area {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

/* Preset Slider */
.preset-slider {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  background: #2a2a2a;
  border-radius: 12px;
  padding: 8px;
}

.preset-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.preset-option:hover {
  color: #999;
}

.preset-option.active {
  color: #fff;
}

.preset-number {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.preset-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
  font-weight: 600;
}

.preset-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: calc((100% - 16px) / 3);
  background: #3a3a3a;
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

/* Flip Clock */
.flip-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 4px;
}

.flip-digit-container {
  perspective: 300px;
}

.flip-digit {
  position: relative;
  width: 52px;
  height: 80px;
  font-size: 56px;
  font-weight: 900;
  color: #1a1a1a;
}

.digit-top,
.digit-bottom {
  position: absolute;
  width: 100%;
  height: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f0f0f0 0%, #e8e8e8 100%);
  border-radius: 8px;
}

.digit-top {
  top: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  align-items: flex-end;
  padding-bottom: 0;
}

.digit-top span {
  transform: translateY(50%);
}

.digit-bottom {
  bottom: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: linear-gradient(180deg, #e0e0e0 0%, #d8d8d8 100%);
  align-items: flex-start;
  padding-top: 0;
}

.digit-bottom span {
  transform: translateY(-50%);
}

.digit-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #1a1a1a;
  z-index: 10;
  transform: translateY(-50%);
}

.flip-card {
  position: absolute;
  width: 100%;
  height: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  font-size: 56px;
  font-weight: 900;
  color: #1a1a1a;
}

.flip-card-top {
  top: 0;
  background: linear-gradient(180deg, #f0f0f0 0%, #e8e8e8 100%);
  border-radius: 8px 8px 0 0;
  transform-origin: bottom center;
  animation: flipTop 0.3s ease-in forwards;
  align-items: flex-end;
}

.flip-card-top span {
  transform: translateY(50%);
}

.flip-card-bottom {
  bottom: 0;
  background: linear-gradient(180deg, #e0e0e0 0%, #d8d8d8 100%);
  border-radius: 0 0 8px 8px;
  transform-origin: top center;
  animation: flipBottom 0.3s ease-out 0.15s forwards;
  transform: rotateX(90deg);
  align-items: flex-start;
}

.flip-card-bottom span {
  transform: translateY(-50%);
}

@keyframes flipTop {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(-90deg);
  }
}

@keyframes flipBottom {
  0% {
    transform: rotateX(90deg);
  }
  100% {
    transform: rotateX(0deg);
  }
}

.clock-colon {
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  opacity: 1;
  transition: opacity 0.1s ease;
  margin: 0 4px;
  align-self: center;
}

.clock-colon.pulse {
  opacity: 0.3;
}

/* Progress Bar */
.progress-container {
  padding: 0 8px;
  margin-bottom: 8px;
}

.progress-track {
  position: relative;
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  overflow: visible;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5d7a4d, #7a9d5d);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.progress-tick {
  position: absolute;
  top: -2px;
  width: 1px;
  height: 10px;
  background: #444;
  transform: translateX(-50%);
}

/* Milliseconds */
.milliseconds {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  font-family: 'Courier New', monospace;
  margin-bottom: 24px;
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.control-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  transition: all 0.1s ease;
}

.control-button:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 12px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.control-button.pressed {
  transform: translateY(2px);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.control-button.disabled:hover {
  transform: none;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.control-button svg {
  width: 24px;
  height: 24px;
}

/* Speaker Decoration */
.speaker-container {
  display: flex;
  align-items: stretch;
  height: 80px;
  background: #f5f5f5;
  border-radius: 50px;
  overflow: hidden;
  margin-top: 8px;
}

.speaker-left,
.speaker-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 12px 20px;
}

.speaker-line {
  height: 3px;
  background: #ddd;
  border-radius: 2px;
}

.speaker-divider {
  width: 2px;
  background: #ccc;
}

/* Keyboard Hints */
.keyboard-hints {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

@media (max-width: 480px) {
  .keyboard-hints {
    display: none;
  }
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px;
}

.app-footer a {
  color: #888;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: #e74c3c;
}

/* Responsive */
@media (max-width: 400px) {
  .app-container {
    max-width: 100%;
  }
  
  .clock-panel {
    padding: 16px;
    border-radius: 0 0 16px 16px;
  }
  
  .flip-digit {
    width: 40px;
    height: 64px;
    font-size: 44px;
  }
  
  .clock-colon {
    font-size: 36px;
  }
  
  .flip-card {
    font-size: 44px;
  }
  
  .preset-slider {
    padding: 6px;
  }
  
  .preset-option {
    padding: 8px 10px;
  }
  
  .preset-number {
    font-size: 14px;
  }
  
  .control-button {
    width: 48px;
    height: 48px;
  }
  
  .speaker-container {
    height: 60px;
  }
}