:root {
  --page-bg: #f7eee2;
  --surface: #fffdf9;
  --surface-border: #e4cfb7;
  --text: #2a2118;
  --muted: #7d6b57;
  --accent: #c27a3a;
  --key-bg: #fff7ed;
  --key-hover: #f3e0cb;
  --key-active: #edccb0;
  --shadow: 0 10px 26px rgba(140, 87, 45, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

.app {
  width: min(1100px, 94vw);
  margin: 24px auto;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
  letter-spacing: 0.01em;
}

.about-section {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.about-details {
  width: min(760px, 100%);
}

.about-details summary {
  width: fit-content;
  margin: 0 auto;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  user-select: none;
}

.about-details summary::-webkit-details-marker {
  display: none;
}

.about-details[open] summary {
  color: var(--accent);
}

.about-content {
  margin-top: 8px;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: #fff9f1;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  padding: 10px 12px;
}

.about-content p {
  margin: 0;
}

.panel {
  margin-top: 20px;
}

.writer-label {
  font-size: 0.9rem;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 8px;
}

.writer {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: #fffdfa;
  color: var(--text);
  padding: 14px 16px;
  font-family: "Noto Sans Arabic", sans-serif;
  font-size: 1.9rem;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.writer:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 122, 58, 0.22);
}

.writer::placeholder {
  color: #94a3b8;
}

.actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fffaf4;
  color: #5b4632;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.action-btn:hover {
  background: #f6e7d6;
  border-color: rgba(194, 122, 58, 0.52);
}

.action-btn:active {
  transform: translateY(1px);
}

.status {
  min-height: 1.4rem;
  color: var(--accent);
  font-size: 0.88rem;
}

.harakat-row {
  margin-top: 10px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 10px;
}

.harakat-btn {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--surface-border);
  border-radius: 9px;
  background: #fffaf4;
  color: var(--text);
  font-family: "Noto Sans Arabic", sans-serif;
  font-size: 1.18rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.harakat-btn:hover {
  background: #f6e7d6;
  border-color: rgba(194, 122, 58, 0.52);
}

.harakat-btn:active {
  transform: translateY(1px);
  background: var(--key-active);
}

.harakat-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(194, 122, 58, 0.2);
}

.keyboard-wrap {
  margin-top: 24px;
  overflow-x: auto;
}

.keyboard {
  width: 100%;
  min-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: grid;
  gap: 10px;
}

.key {
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--key-bg);
  color: var(--text);
  min-height: 62px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.key:hover {
  background: var(--key-hover);
}

.key:active,
.key.active {
  transform: translateY(1px) scale(0.99);
  border-color: rgba(194, 122, 58, 0.62);
  background: var(--key-active);
}

.key[data-kind="wide"] {
  grid-column: span 2;
}

.key[data-kind="space"] {
  grid-column: span 5;
}

.key-ar {
  font-family: "Noto Sans Arabic", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

.key-en {
  font-family: "Manrope", sans-serif;
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: lowercase;
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: 22px;
  height: 22px;
  display: block;
}

.youtube-logo {
  width: 24px;
  height: 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 850px) {
  .app {
    padding: 18px;
    margin: 16px auto;
    border-radius: 14px;
  }

  .writer {
    font-size: 1.65rem;
  }
}
