﻿/* /typing/assets/css/typing.css */
:root {
  --tt-bg: #f5f9ff;
  --tt-card: #ffffff;
  --tt-text: #0f172a;
  --tt-muted: #64748b;
  --tt-brand: #1d4ed8;
  --tt-brand-2: #0ea5e9;
  --tt-border: #dbe7ff;
  --tt-success: #065f46;
  --tt-error: #7f1d1d;
}

.tt-main {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  min-height: calc(100vh - 120px);
}

.tt-section {
  padding: 28px 0;
}

.tt-wrap {
  width: min(1180px, calc(100% - 28px));
  margin-inline: auto;
}

.tt-hero {
  background: radial-gradient(circle at top right, #e9f2ff 0%, #ffffff 58%);
  border: 1px solid var(--tt-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.tt-hero h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.12;
  color: var(--tt-text);
}

.tt-hero p {
  margin: 10px 0 0;
  color: #334155;
  font-size: 15px;
}

.tt-keywords {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tt-keyword {
  border: 1px solid #d9e7ff;
  border-radius: 999px;
  background: #f8fbff;
  padding: 6px 10px;
  font-size: 12px;
  color: #1d4ed8;
  font-weight: 600;
}

.tt-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

.tt-card {
  border: 1px solid var(--tt-border);
  border-radius: 16px;
  background: var(--tt-card);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: 16px;
}

.tt-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.tt-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: #0f172a;
  font-size: 13px;
}

.tt-select,
.tt-input {
  width: 100%;
  border: 1px solid #cdddfd;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
}

.tt-btn {
  border: 1px solid #cdddfd;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .16s ease;
}

.tt-btn:hover {
  border-color: #b6cdfb;
  background: #f7fbff;
}

.tt-btn-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--tt-brand), var(--tt-brand-2));
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.28);
}

.tt-btn-primary:hover {
  filter: brightness(1.04);
}

.tt-statusbar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tt-chip {
  background: #f8fbff;
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  color: #1e3a8a;
  font-weight: 700;
}

.tt-timer {
  font-size: 19px;
  letter-spacing: 0.4px;
  color: #0b3f95;
}

.tt-typing-shell {
  margin-top: 16px;
  position: relative;
}

.tt-unified-panel {
  border: 1px solid #d3e3ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.tt-unified-panel:focus-within {
  border-color: #8db2ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.tt-unified-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #35508a;
  text-transform: uppercase;
}

.tt-unified-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tt-unified-hint {
  font-size: 12px;
  color: #54688e;
  font-weight: 600;
}

.tt-unified-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(186, 205, 245, 0) 0%, rgba(186, 205, 245, 1) 15%, rgba(186, 205, 245, 1) 85%, rgba(186, 205, 245, 0) 100%);
  margin: 12px 0;
}

.tt-passage {
  border: 0;
  border-radius: 0;
  min-height: 220px;
  max-height: 300px;
  padding: 8px 2px 2px;
  background: transparent;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.7;
  color: #0f172a;
  user-select: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
}

.tt-char {
  transition: color .16s ease, opacity .16s ease, background-color .16s ease, box-shadow .16s ease;
  opacity: .5;
}

.tt-char.correct {
  opacity: 1;
  color: #0f172a;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 2px;
}

.tt-char.wrong {
  opacity: 1;
  color: var(--tt-error);
  background: #fee2e2;
  border-radius: 2px;
}

.tt-char.current {
  opacity: .9;
  box-shadow: 0 1px 0 rgba(29, 78, 216, .35);
}

.tt-typing-input {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  border: 0;
  padding: 0;
  margin: 0;
  resize: none;
  pointer-events: none;
  caret-color: transparent;
}

.tt-typing-input:focus {
  outline: none;
}

.tt-note {
  margin-top: 10px;
  color: var(--tt-muted);
  font-size: 13px;
}

.tt-progress-wrap {
  margin-top: 12px;
  display: none;
}

.tt-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #dbeafe;
}

.tt-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  transition: width .24s ease;
}

.tt-progress-text {
  margin-top: 8px;
  font-size: 13px;
  color: #1e3a8a;
  font-weight: 700;
}

.tt-ad {
  border: 1px dashed #bfd3fb;
  border-radius: 12px;
  background: #f8fbff;
  color: #334155;
  text-align: center;
  padding: 14px;
  font-size: 13px;
}

.tt-ad + .tt-ad {
  margin-top: 12px;
}

.tt-ad-slot-top,
.tt-ad-slot-inline,
.tt-ad-slot-bottom {
  margin-top: 12px;
}

.tt-seo-block {
  margin-top: 16px;
  color: #334155;
  font-size: 14px;
  line-height: 1.65;
}

.tt-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.62);
  padding: 14px;
  align-items: center;
  justify-content: center;
}

.tt-modal.open {
  display: flex;
}

.tt-modal-card {
  width: min(860px, 100%);
  background: #fff;
  border: 1px solid #d9e7ff;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.26);
  overflow: hidden;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
}

.tt-modal-head {
  padding: 14px 16px;
  background: linear-gradient(180deg, #eef5ff 0%, #ffffff 100%);
  border-bottom: 1px solid #dce8ff;
}

.tt-modal-head h3 {
  margin: 0;
  font-size: 20px;
  color: #0b3f95;
}

.tt-modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tt-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tt-result-item {
  border: 1px solid #dfebff;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fafcff;
}

.tt-result-item small {
  display: block;
  color: #64748b;
  font-size: 11px;
}

.tt-result-item strong {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 14px;
}

.tt-alerts {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.tt-alert {
  border: 1px solid #d6e6ff;
  border-radius: 10px;
  padding: 9px 11px;
  background: #f8fbff;
  color: #1e3a8a;
  font-size: 13px;
}

.tt-name-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.tt-footer-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .tt-grid {
    grid-template-columns: 1fr;
  }

  .tt-controls {
    grid-template-columns: 1fr;
  }

  .tt-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tt-name-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tt-wrap {
    width: min(100%, calc(100% - 20px));
  }

  .tt-hero,
  .tt-card {
    border-radius: 14px;
    padding: 14px;
  }

  .tt-passage {
    min-height: 200px;
    max-height: 260px;
    padding: 6px 2px 2px;
    line-height: 1.62;
  }

  .tt-result-grid {
    grid-template-columns: 1fr;
  }

  .tt-unified-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .tt-modal {
    padding: 8px;
    align-items: flex-end;
  }

  .tt-modal-card {
    width: 100%;
    max-height: calc(100vh - 8px);
    max-height: calc(100dvh - 8px);
    border-radius: 14px 14px 0 0;
  }

  .tt-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .tt-modal-body {
    padding: 12px;
  }

  .tt-name-row .tt-btn,
  .tt-footer-actions .tt-btn {
    width: 100%;
  }

  .tt-footer-actions {
    justify-content: stretch;
  }
}
