:root {
  --bg-color: #0b0d11;
  --card-bg: #13171f;
  --text-main: #f0f3f6;
  --text-dim: #8b949e;
  --text-sub: #586069;
  --accent-ready: #238636;
  --accent-listen: #e3b341;
  --accent-think: #388bfd;
  --accent-speak: #a371f7;
  --accent-error: #f85149;
  --ring-level: 0px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* App container */
.app-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding: 10px 16px;
  gap: 16px;
}

/* Big Round Button */
.btn-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
}

.level-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  transition: box-shadow 0.08s ease-out, transform 0.08s ease-out;
}

.action-btn {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: #1c212c;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.action-btn:active {
  transform: scale(0.93);
}

.action-btn svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
  transition: fill 0.2s ease, transform 0.2s ease;
}

/* States */
/* 1. Bereit (Ready) */
.state-bereit .action-btn {
  border-color: rgba(35, 134, 54, 0.4);
  color: #3fb950;
  background: radial-gradient(circle, #1a2720 0%, #12181d 100%);
}
.state-bereit .level-ring {
  box-shadow: 0 0 8px rgba(35, 134, 54, 0.2);
}

/* 2. Hört zu (Listening) */
.state-hoert .action-btn {
  border-color: var(--accent-listen);
  color: #fff;
  background: radial-gradient(circle, #382c0e 0%, #1f1b12 100%);
}
.state-hoert .level-ring {
  box-shadow: 0 0 calc(6px + var(--ring-level)) var(--accent-listen);
  transform: scale(calc(1 + (var(--ring-level) / 80)));
}

/* 3. Denkt nach (Thinking) */
.state-denkt .action-btn {
  border-color: var(--accent-think);
  color: #58a6ff;
  background: radial-gradient(circle, #152744 0%, #0f1724 100%);
  animation: pulse-think 1.4s infinite ease-in-out;
}
.state-denkt .level-ring {
  box-shadow: 0 0 14px rgba(56, 139, 253, 0.4);
}

/* 4. Spricht (Speaking) */
.state-spricht .action-btn {
  border-color: var(--accent-speak);
  color: #bc8cff;
  background: radial-gradient(circle, #2d1e47 0%, #181424 100%);
  animation: pulse-speak 1.2s infinite alternate ease-in-out;
}
.state-spricht .level-ring {
  box-shadow: 0 0 16px rgba(163, 113, 247, 0.5);
}

/* Animations */
@keyframes pulse-think {
  0% { transform: scale(0.98); opacity: 0.85; }
  50% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(0.98); opacity: 0.85; }
}

@keyframes pulse-speak {
  0% { box-shadow: 0 0 8px rgba(163, 113, 247, 0.3); }
  100% { box-shadow: 0 0 20px rgba(163, 113, 247, 0.7); }
}

/* Info Section */
.info-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.status-line {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
  flex-shrink: 0;
}

.state-bereit .status-dot { background: var(--accent-ready); }
.state-hoert .status-dot { background: var(--accent-listen); }
.state-denkt .status-dot { background: var(--accent-think); }
.state-spricht .status-dot { background: var(--accent-speak); }

.detail-line {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.detail-line.answer {
  color: #e6edf3;
}

/* Login Page Styles */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1117;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 320px;
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.login-card h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  color: var(--text-main);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #58a6ff;
}

.login-btn {
  width: 100%;
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background-color 0.2s;
}

.login-btn:hover {
  background: #2ea043;
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  color: var(--accent-error);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
}
