:root {
  --bg: #18120f;
  --panel: rgba(31, 24, 20, 0.88);
  --line: rgba(236, 217, 201, 0.18);
  --text: #f7ede3;
  --muted: #cdb4a3;
  --accent: #d68b57;
  --danger: #df6c63;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(24, 18, 15, 0.86), rgba(24, 18, 15, 0.86)),
    url("/assets/backgrounds/01_leather.jpg") center / cover fixed no-repeat;
  font-family: "Yu Gothic", "Hiragino Sans", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(960px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.page-head,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 6px 0 8px;
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.eyebrow,
.lead,
.page-links,
.field small,
.card-meta,
.empty {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
}

.lead {
  margin: 0;
  line-height: 1.7;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
}

.panel {
  padding: 18px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.gallery-card,
.admin-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.gallery-card img,
.admin-thumb img,
.image-preview {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.gallery-card img {
  aspect-ratio: 1 / 1;
}

.admin-row-body {
  padding: 14px;
}

.card-meta {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.card-comment,
.admin-comment {
  margin: 0;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty,
.message {
  margin: 0;
  padding: 12px;
}

.message {
  border-radius: 14px;
  background: rgba(214, 139, 87, 0.14);
}

.message.error {
  background: rgba(223, 108, 99, 0.14);
}

.admin-list {
  display: grid;
  gap: 14px;
}

.admin-row {
  display: grid;
  grid-template-columns: 110px 1fr;
}

.admin-thumb img {
  width: 110px;
  height: 110px;
}

.admin-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-actions a,
.admin-actions button,
.form-actions button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  text-decoration: none;
}

.form-actions .primary {
  background: var(--accent);
  color: #1a120d;
  border-color: transparent;
  font-weight: 700;
}

.form-actions .danger,
.admin-actions .danger {
  border-color: rgba(223, 108, 99, 0.35);
  color: #ffd2ce;
}

.selfie-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.preview-wrap {
  border: 1px dashed var(--line);
  border-radius: 18px;
  overflow: hidden;
  min-height: 120px;
}

.image-preview {
  max-height: 520px;
}

@media (max-width: 720px) {
  .page-head {
    flex-direction: column;
  }

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

  .admin-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .shell {
    width: min(100% - 16px, 960px);
    padding: 16px 0 32px;
  }

  .panel,
  .page-head {
    padding: 16px;
  }
}
