:root {
  --bg: #f8f1e6;
  --paper: #fff8ef;
  --ink: #3d2a1d;
  --accent: #b44b26;
  --accent-dark: #8b371a;
  --line: #cdb69a;
  --soft: #efe2d1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f9f2e6 0%, #f0e0c9 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header,
.site-footer {
  padding: 12px 14px;
  background: #f2dec5;
  border-bottom: 2px solid var(--line);
}

.site-footer {
  border-top: 2px solid var(--line);
  border-bottom: 0;
  margin-top: auto;
}

.logo {
  color: var(--ink);
  text-decoration: none;
  font-weight: bold;
  font-size: 19px;
}

.top-nav,
.footer-links,
.language-menu {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.top-nav a,
.footer-links a,
.language-menu a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--ink);
}

.language-menu a.active {
  font-weight: bold;
  border-bottom-style: solid;
}

.container {
  width: min(680px, 100% - 20px);
  margin: 12px auto;
  flex: 1;
}

.hero-card,
.result-box,
.doc-box,
.admin-box,
.home-article {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 3px 0 #d8c2a3;
}

.home-article {
  margin-top: 14px;
}

.home-article h2 {
  margin-top: 0;
  font-size: 30px;
  line-height: 1.2;
}

.home-article p {
  font-size: 20px;
  line-height: 1.75;
  margin: 10px 0;
}

.subtitle {
  margin-top: 0;
  font-size: 17px;
}

.hero-card label {
  display: block;
  margin: 6px 0;
}

.hero-card .category-label {
  font-size: 35px;
  line-height: 1.2;
  margin-top: 10px;
  margin-bottom: 10px;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.category-btn {
  border: 2px solid var(--line);
  background: #fffaf2;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.category-btn.active {
  background: #f1d4b0;
  border-color: #9a6a3e;
  font-weight: bold;
}

.cards-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
}

.tarot-card {
  width: 90px;
  height: 138px;
  border: 2px solid #7f6144;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background:
    repeating-linear-gradient(
      45deg,
      #ccb190,
      #ccb190 8px,
      #e2cfb4 8px,
      #e2cfb4 16px
    );
}

.drawn-card {
  width: 92px;
  text-align: center;
}

.drawn-card img {
  width: 92px;
  height: 138px;
  object-fit: cover;
  border: 2px solid #7f6144;
  border-radius: 8px;
  background: #e8d5bd;
}

.drawn-card p {
  margin: 6px 0 0;
  font-size: 12px;
}

.cta-btn,
.ghost-btn,
input,
textarea,
select {
  font: inherit;
}

.cta-btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff7ef;
  padding: 15px 14px;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
}

.cta-btn:hover {
  background: var(--accent-dark);
}

.inline-btn {
  text-decoration: none;
  text-align: center;
  margin-top: 20px;
}

.reading-title {
  font-size: 28px;
  line-height: 1.3;
  margin-top: 16px;
}

.reading-content p {
  font-size: 21px;
  line-height: 1.8;
  margin: 14px 0;
}

.ghost-btn {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  margin-top: 10px;
  cursor: pointer;
}

.ghost-btn.danger {
  border-color: #9f3328;
  color: #9f3328;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 4, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff8ef;
  border: 2px solid var(--line);
  border-radius: 8px;
  width: min(460px, 100%);
  padding: 14px;
}

.form-stack {
  display: grid;
  gap: 8px;
}

input,
textarea,
select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.ok {
  color: #146a2e;
}

.error {
  color: #8e1208;
}

.admin-actions {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .site-header,
  .site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .top-nav,
  .footer-links,
  .language-menu {
    margin-top: 0;
  }

  .tarot-card {
    width: 120px;
    height: 170px;
  }

  .drawn-card {
    width: 120px;
  }

  .drawn-card img {
    width: 120px;
    height: 170px;
  }
}
