/* Тёмная тема под Telegram через переменные --tg-theme-*. */
:root {
  --bg: var(--tg-theme-bg-color, #17212b);
  --text: var(--tg-theme-text-color, #f5f5f5);
  --hint: var(--tg-theme-hint-color, #708499);
  --btn: var(--tg-theme-button-color, #3390ec);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #232e3c);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.status {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--hint);
  text-align: center;
  background: var(--secondary-bg);
}
.status.ok { color: #4caf50; }
.status.err { color: #e53935; }

#screen-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  /* Оставляем место под панель управления. */
  height: calc(100% - 170px);
  background: #000;
}

#screen {
  max-width: 100%;
  max-height: 100%;
  touch-action: none; /* перехватываем жесты сами */
}

#controls {
  padding: 8px;
  background: var(--secondary-bg);
}

.keys {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.keys button {
  flex: 1;
  padding: 10px 4px;
  font-size: 14px;
}

.text-row {
  display: flex;
  gap: 6px;
}
#text-input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

button {
  border: none;
  border-radius: 8px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 15px;
  cursor: pointer;
}
#send-text { padding: 10px 14px; }

.hint {
  margin: 8px 2px 0;
  font-size: 12px;
  color: var(--hint);
}
