/* ===== Sutra Reading Screen ===== */

#screen-counter {
  gap: var(--space-sm);
}

/* Header */
.counter-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.counter-target {
  font-family: var(--font-gothic);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* ===== Sutra vertical text area ===== */
.sutra-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: relative;
  min-height: 280px;
}

.sutra-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-primary);
  font-size: 1.3rem;
  line-height: 2.2;
  letter-spacing: 0.08em;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  height: 100%;
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: row;
  gap: 0;
  scroll-behavior: smooth;
}

.sutra-phrase {
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.4s ease, text-shadow 0.4s ease, transform 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
  padding: 0 var(--space-xs);
}

.sutra-phrase.completed {
  color: rgba(212, 197, 160, 0.45);
}

.sutra-phrase.current {
  color: #FFD700;
  font-weight: 700;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.5), 0 0 32px rgba(255, 215, 0, 0.2);
  animation: sutra-glow 2s ease-in-out infinite;
}

.sutra-phrase.upcoming {
  color: rgba(255, 255, 255, 0.3);
}

@keyframes sutra-glow {
  0%, 100% {
    text-shadow: 0 0 16px rgba(255, 215, 0, 0.5), 0 0 32px rgba(255, 215, 0, 0.2);
  }
  50% {
    text-shadow: 0 0 24px rgba(255, 215, 0, 0.7), 0 0 48px rgba(255, 215, 0, 0.3);
  }
}

/* Flash animation when phrase matches */
.sutra-phrase.flash {
  animation: sutra-flash 0.6s ease-out;
}

@keyframes sutra-flash {
  0% {
    color: #FFFFFF;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    transform: scale(1.08);
  }
  100% {
    color: rgba(212, 197, 160, 0.45);
    text-shadow: none;
    transform: scale(1);
  }
}

/* Progress info */
.sutra-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
}

.sutra-progress-bar {
  width: 100%;
  max-width: 320px;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.sutra-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-bg-gradient-start), var(--color-button));
  transition: width 0.4s ease;
  min-width: 0;
}

.sutra-progress-text {
  font-family: var(--font-gothic);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* Stats row */
.sutra-stats {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  padding: var(--space-xs) 0;
}

.sutra-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sutra-stat-value {
  font-family: var(--font-gothic);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 4px rgba(0, 0, 0, 0.4);
}

.sutra-stat-label {
  font-family: var(--font-gothic);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* Mic indicator */
.mic-indicator {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-icon {
  font-size: 28px;
  z-index: 1;
  filter: grayscale(1) brightness(0.6);
  transition: filter 0.3s;
}

.mic-indicator.listening .mic-icon {
  filter: none;
}

.mic-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.15);
  opacity: 0;
  transition: opacity 0.3s;
}

.mic-indicator.listening .mic-pulse {
  opacity: 1;
  animation: mic-pulse-anim 1.5s ease-in-out infinite;
}

@keyframes mic-pulse-anim {
  0% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 0.2; }
  100% { transform: scale(0.8); opacity: 0.6; }
}

/* Mic status area */
.counter-mic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
}

.counter-mic-status {
  font-family: var(--font-gothic);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  transition: color 0.3s;
}

.counter-mic-status.listening {
  color: #4CAF50;
}

.counter-mic-status.paused {
  color: #9E9E9E;
}

.counter-mic-status.error,
.counter-mic-status.unsupported {
  color: #F44336;
}

/* Real-time transcript */
.counter-transcript {
  font-family: var(--font-gothic);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  min-height: 1.2em;
  text-align: center;
  opacity: 0.7;
  font-style: italic;
}

/* Tap hint for manual mode */
.counter-tap-hint {
  display: none;
  text-align: center;
  font-family: var(--font-gothic);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
}

.counter-tap-hint.visible {
  display: block;
}

/* Hide mic section when speech not available */
.counter-mic.hidden {
  display: none;
}

/* Large manual button for touch mode */
.btn-manual-large {
  display: none;
  width: 100%;
  padding: var(--space-md);
  font-size: var(--font-size-lg);
  font-weight: 700;
  background: var(--color-button);
  color: var(--color-button-text);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-button);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
}

.btn-manual-large.visible {
  display: block;
}

.btn-manual-large:active {
  transform: scale(0.96);
}

/* Controls */
.counter-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.counter-controls .btn {
  min-width: 90px;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
}
