:root {
  --bg: #f5e6d3;
  --panel: rgba(255, 243, 226, 0.82);
  --accent: #e66a2c;
  --accent-2: #f2c14f;
  --text: #2f1c0f;
  --muted: #5e4330;
  --card-border: rgba(230, 106, 44, 0.55);
  --shadow: 0 14px 32px rgba(146, 96, 53, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Lato", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 18%, rgba(230, 106, 44, 0.28), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(242, 193, 79, 0.28), transparent 24%),
    radial-gradient(circle at 50% 86%, rgba(165, 112, 52, 0.26), transparent 24%),
    linear-gradient(135deg, #f5e6d3 0%, #f7d9b6 45%, #f2c14f 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 32px 16px 64px;
  line-height: 1.6;
}

body[data-theme="pastel"] {
  --bg: #cdb4db;
  --panel: rgba(255, 200, 221, 0.7);
  --accent: #ffc8dd;
  --accent-2: #ffafcc;
  --text: #2f2435;
  --muted: #5b4d5f;
  --card-border: rgba(255, 175, 204, 0.6);
  --shadow: 0 14px 32px rgba(173, 123, 169, 0.25);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 130, 178, 0.45), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(189, 224, 254, 0.45), transparent 24%),
    radial-gradient(circle at 50% 86%, rgba(255, 175, 204, 0.45), transparent 24%),
    linear-gradient(135deg, #cdb4db 0%, #bde0fe 50%, #a2d2ff 100%);
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px;
  border: 1px solid rgba(230, 106, 44, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 235, 214, 0.86));
  box-shadow: var(--shadow);
  position: relative;
}

body[data-theme="pastel"] .hero {
  border: 1px solid rgba(255, 175, 204, 0.6);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 200, 221, 0.82));
}

.hero h1 {
  margin: 0;
  font-family: "Lato", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: 0.2px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  font-size: 16px;
}

.theme-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid rgba(47, 36, 53, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 235, 0.75));
  color: var(--text);
  border-radius: 6px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(146, 96, 53, 0.18);
  transition: all 140ms ease;
}

.theme-toggle:hover {
  border-color: rgba(230, 106, 44, 0.5);
  box-shadow: 0 8px 18px rgba(146, 96, 53, 0.25);
}

body[data-theme="pastel"] .theme-toggle {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 200, 221, 0.78));
  box-shadow: 0 6px 16px rgba(173, 123, 169, 0.18);
}

body[data-theme="pastel"] .theme-toggle:hover {
  border-color: rgba(255, 175, 204, 0.6);
  box-shadow: 0 8px 18px rgba(173, 123, 169, 0.25);
}

.controls {
  margin: 18px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.55);
}

body[data-theme="pastel"] .search {
  background: rgba(255, 255, 255, 0.45);
}

.search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.search input::placeholder {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(230, 106, 44, 0.4);
  background: linear-gradient(135deg, rgba(242, 193, 79, 0.32), rgba(255, 243, 226, 0.6));
  color: #3b281d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

body[data-theme="pastel"] .pill {
  border: 1px solid rgba(255, 200, 221, 0.6);
  background: linear-gradient(135deg, rgba(255, 200, 221, 0.35), rgba(189, 224, 254, 0.3));
  color: #3f3347;
}

.grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.random-block {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px dashed rgba(230, 106, 44, 0.4);
  border-radius: 8px;
  background: rgba(255, 249, 241, 0.8);
}

body[data-theme="pastel"] .random-block {
  border: 1px dashed rgba(255, 200, 221, 0.65);
  background: rgba(255, 255, 255, 0.7);
}

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

.random-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.random-head button {
  border: 1px solid rgba(47, 36, 53, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(242, 193, 79, 0.5));
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 140ms ease;
}

.random-head button:hover {
  border-color: rgba(230, 106, 44, 0.6);
  box-shadow: 0 4px 12px rgba(146, 96, 53, 0.25);
}

body[data-theme="pastel"] .random-head button {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 200, 221, 0.78));
}

body[data-theme="pastel"] .random-head button:hover {
  border-color: rgba(255, 175, 204, 0.7);
  box-shadow: 0 4px 12px rgba(173, 123, 169, 0.25);
}

.card {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 238, 217, 0.88));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  position: relative;
}

.card:hover {
  border-color: rgba(230, 106, 44, 0.7);
  box-shadow: 0 10px 24px rgba(146, 96, 53, 0.3);
}

body[data-theme="pastel"] .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 200, 221, 0.82));
}

body[data-theme="pastel"] .card:hover {
  border-color: rgba(255, 175, 204, 0.8);
  box-shadow: 0 10px 24px rgba(173, 123, 169, 0.3);
}

.card h3 {
  margin: 0;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.1px;
  font-family: "Lato", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.badge {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: #2f2435;
}

.badge-original {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.lang-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 243, 226, 0.7), rgba(242, 193, 79, 0.18));
  border: 1px solid rgba(230, 106, 44, 0.35);
}

.lang-row.is-original {
  background: linear-gradient(90deg, rgba(255, 229, 180, 0.7), rgba(242, 193, 79, 0.85));
  border-color: rgba(242, 193, 79, 0.75);
  box-shadow: 0 6px 16px rgba(146, 96, 53, 0.22);
}

body[data-theme="pastel"] .lang-row {
  background: linear-gradient(90deg, rgba(255, 200, 221, 0.35), rgba(189, 224, 254, 0.35));
  border: 1px solid rgba(255, 175, 204, 0.5);
}

body[data-theme="pastel"] .lang-row.is-original {
  background: linear-gradient(90deg, rgba(255, 248, 210, 0.65), rgba(255, 236, 179, 0.82));
  border-color: rgba(255, 206, 102, 0.7);
  box-shadow: 0 6px 16px rgba(173, 123, 169, 0.22);
}

.lang-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.lang-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #a1542e;
  font-size: 12px;
}

body[data-theme="pastel"] .lang-label {
  color: #a64f7a;
}

.lang-title {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-row a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  border: 1px solid rgba(47, 36, 53, 0.18);
  padding: 6px 8px;
  min-width: 36px;
  text-align: center;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(242, 193, 79, 0.35));
  transition: all 140ms ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-row a:hover {
  color: #2f2435;
  background: linear-gradient(135deg, rgba(255, 244, 231, 0.96), rgba(242, 193, 79, 0.45));
  border-color: rgba(230, 106, 44, 0.55);
  box-shadow: 0 4px 12px rgba(146, 96, 53, 0.22);
}

body[data-theme="pastel"] .lang-row a {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 200, 221, 0.65));
}

body[data-theme="pastel"] .lang-row a:hover {
  background: linear-gradient(135deg, rgba(255, 240, 248, 0.96), rgba(189, 224, 254, 0.96));
  border-color: rgba(255, 175, 204, 0.65);
  box-shadow: 0 4px 12px rgba(173, 123, 169, 0.22);
}

.status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.error {
  color: #fca5a5;
  font-weight: 600;
}

.footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.footer a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  body {
    padding: 24px 14px 48px;
  }

  .hero {
    padding: 16px 18px;
  }

  .lang-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .lang-row a {
    width: auto;
    margin-left: auto;
  }
}
