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

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --accent: #0f3460;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --radius: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 20px 16px;
  gap: 20px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* HEADER */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

#status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

#status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
}

#status-dot.connected { background: var(--green); }
#status-dot.connecting { background: var(--yellow); animation: pulse 1s infinite; }
#status-dot.error { background: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* DIRECTION BUTTONS */
#direction-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dir-btn {
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.05rem;
  padding: 16px;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}

.dir-btn.active {
  border-color: var(--green);
  background: var(--accent);
}

.dir-btn:not(.active):hover {
  border-color: var(--muted);
}

.arrow {
  color: var(--muted);
  font-size: 1.2rem;
}

/* SUBTITLES */
#subtitles-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

#original-box,
#translation-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#translation-box {
  border: 1px solid var(--green);
}

.box-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transcript {
  font-size: 1.25rem;
  line-height: 1.5;
  min-height: 60px;
}

/* CONTROLS */
#controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.session-btn {
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 18px 48px;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
}

.session-btn.start { background: var(--green); color: #0f172a; }
.session-btn.stop  { background: var(--red);   color: #fff; }
.session-btn:active { transform: scale(0.97); }

#cost-info {
  color: var(--muted);
  font-size: 0.8rem;
}
