/* ============================================
   TIMER CRONÔMETRO — Tatame PRO
   Tela fullscreen de alto contraste para tatame.
   Fundo #000 (OLED), tipografia escalável (vw).
   ============================================ */

/* --- Container Fullscreen --- */
.timer-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Montserrat', 'Inter', sans-serif;
}

/* --- Botão Fechar (X) --- */
.timer-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.timer-close-btn:active {
  background: rgba(255,255,255,0.15);
}

/* --- Abas (Execução / Configuração) --- */
.timer-tabs {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 60px;
}

.timer-tab {
  flex: 1;
  padding: 14px 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.03em;
}

.timer-tab.active {
  color: #e9c349;
  border-bottom-color: #e9c349;
}

/* --- Tela de Execução --- */
.timer-exec-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 16px;
}

/* Label de Estado (LUTA, DESCANSO, PREPARO) */
.timer-state-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 6vw;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #4edea3;
  transition: color 0.3s ease;
}

.timer-state-label.state-fighting {
  color: #4edea3;
}

.timer-state-label.state-warning {
  color: #ef4444;
}

.timer-state-label.state-resting {
  color: #60a5fa;
}

.timer-state-label.state-preparing {
  color: #e9c349;
}

.timer-state-label.state-finished {
  color: #e9c349;
}

.timer-state-label.state-idle {
  color: rgba(255,255,255,0.3);
}

/* Display do Timer (MM:SS) */
.timer-display {
  font-family: 'Montserrat', sans-serif;
  font-size: 22vw;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
}

.timer-display.warning {
  color: #ef4444;
}

/* Badge de Round */
.timer-round-badge {
  padding: 8px 28px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #e9c349;
  letter-spacing: 0.02em;
}

/* Info de próximo estado */
.timer-next-info {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Controles (Reset, Pause/Play, Skip) --- */
.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 24px 40px;
}

.timer-ctrl-btn {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.timer-ctrl-btn:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.1);
}

.timer-ctrl-btn svg {
  width: 24px;
  height: 24px;
}

/* Botão principal (Play/Pause) */
.timer-ctrl-btn.primary {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  background: #e9c349;
  border: none;
  color: #000000;
}

.timer-ctrl-btn.primary:active {
  background: #d4af37;
}

.timer-ctrl-btn.primary svg {
  width: 36px;
  height: 36px;
}

/* --- Tela de Configuração --- */
.timer-config-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 40px;
  -webkit-overflow-scrolling: touch;
}

.timer-config-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #e9c349;
  margin-bottom: 4px;
}

.timer-config-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Card de Configuração (Luta, Descanso) */
.timer-config-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border-left: 3px solid rgba(255,255,255,0.1);
}

.timer-config-card.card-fight {
  border-left-color: #4edea3;
}

.timer-config-card.card-rest {
  border-left-color: #60a5fa;
}

.timer-config-card.card-prep {
  border-left-color: #e9c349;
}

.timer-config-card.card-rounds {
  border-left-color: #a78bfa;
}

.timer-config-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.timer-config-card-icon {
  width: 28px;
  height: 28px;
  color: rgba(255,255,255,0.6);
}

.timer-config-card-label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.8);
}

/* Inputs de Tempo (Flip Clock) */
.timer-time-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.timer-time-input {
  width: 80px;
  height: 72px;
  background: #1d2022;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: white;
  font-family: 'Montserrat', monospace;
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.timer-time-input:focus {
  border-color: #e9c349;
  box-shadow: 0 0 0 2px rgba(233,195,73,0.15);
}

.timer-time-input::-webkit-inner-spin-button,
.timer-time-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timer-time-separator {
  font-family: 'Montserrat', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
}

.timer-time-hint {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Card inline (Preparo / Rounds) */
.timer-config-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.timer-config-inline-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timer-config-inline-label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

.timer-config-inline-sublabel {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* Input numérico compacto (Preparo) */
.timer-compact-input {
  width: 56px;
  height: 44px;
  background: #1d2022;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.timer-compact-input:focus {
  border-color: #e9c349;
}

.timer-compact-input::-webkit-inner-spin-button,
.timer-compact-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timer-compact-suffix {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin-left: 6px;
}

/* Stepper de Rounds (+/-) */
.timer-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

.timer-stepper-btn {
  width: 40px;
  height: 40px;
  background: #1d2022;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.timer-stepper-btn:active {
  background: rgba(255,255,255,0.1);
}

.timer-stepper-value {
  width: 48px;
  height: 40px;
  background: #272a2c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: white;
  border-left: 1px solid rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.06);
}

/* Botão START (na aba Configuração) */
.timer-start-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  background: #e9c349;
  border: none;
  color: #000;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}

.timer-start-btn:active {
  transform: scale(0.97);
  background: #d4af37;
}

/* --- Presets Rápidos --- */
.timer-presets-wrapper {
  margin-bottom: 20px;
}

.timer-presets-title {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e9c349;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.timer-preset-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 8px;
  color: rgba(255,255,255,0.8);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.timer-preset-chip:active, .timer-preset-chip.active {
  background: rgba(233,195,73,0.15);
  border-color: #e9c349;
  color: #e9c349;
}

.timer-preset-chip-title {
  font-weight: 700;
  font-size: 12px;
}

.timer-preset-chip-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
}

.timer-preset-chip.active .timer-preset-chip-sub {
  color: rgba(233,195,73,0.8);
}

/* --- Stepper Tátil de Tempo (+/-) --- */
.timer-touch-stepper-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.timer-touch-unit {
  display: flex;
  align-items: center;
  background: #1d2022;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  overflow: hidden;
}

.timer-touch-btn {
  width: 36px;
  height: 54px;
  background: rgba(255,255,255,0.05);
  border: none;
  color: #e9c349;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.timer-touch-btn:active {
  background: rgba(233,195,73,0.2);
}

.timer-touch-val {
  width: 52px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', monospace;
  font-size: 26px;
  font-weight: 700;
  color: white;
  user-select: none;
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
}

.timer-touch-label {
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.4);
  text-align: center;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timer-touch-unit-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Chips de Atalho Rápido (+30s, +1m, etc) --- */
.timer-quick-add-bar {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.timer-quick-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.timer-quick-chip:active {
  background: rgba(233,195,73,0.2);
  color: #e9c349;
  border-color: #e9c349;
}

/* Animação de pulso nos últimos 10s */
@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.timer-display.pulse {
  animation: timer-pulse 1s ease-in-out infinite;
}

/* Responsividade para telas menores */
@media (max-width: 359px) {
  .timer-display {
    font-size: 26vw;
  }
  .timer-time-input {
    width: 64px;
    height: 60px;
    font-size: 28px;
  }
}

/* Landscape */
@media (orientation: landscape) and (max-height: 500px) {
  .timer-exec-area {
    padding: 8px 24px;
    gap: 8px;
  }
  .timer-state-label {
    font-size: 4vh;
  }
  .timer-display {
    font-size: 18vh;
  }
  .timer-controls {
    padding: 8px 24px 16px;
  }
  .timer-ctrl-btn {
    width: 48px;
    height: 48px;
  }
  .timer-ctrl-btn.primary {
    width: 64px;
    height: 64px;
  }
}
