:root {
  color-scheme: light;
  --paper: 40, 34, 38;
  --cream: 31, 26, 29;
  --rose: 193, 93, 125;
  --rose-deep: 152, 65, 95;
  --muted: 112, 101, 106;
}

html,
body {
  background: #f1eae6;
}

body {
  color: #292227;
  background:
    radial-gradient(circle at 12% 13%, rgba(211, 125, 150, .26), transparent 25%),
    radial-gradient(circle at 88% 72%, rgba(133, 111, 175, .14), transparent 27%),
    linear-gradient(145deg, #f5f0ed, #e9dfdb 50%, #f6f2ef);
}

.grain {
  opacity: .025;
  mix-blend-mode: multiply;
}

.site-header {
  border-color: rgba(45, 37, 42, .09);
}

.back-link,
.owner-button {
  color: rgba(45, 37, 42, .86);
  font-size: 11px;
  font-weight: 750;
}

.back-link:hover,
.owner-button:hover {
  color: rgb(var(--rose-deep));
}

.site-mark {
  color: rgba(45, 37, 42, .7);
  font-size: 10px;
  font-weight: 700;
}

.eyebrow {
  color: rgb(var(--rose-deep));
  font-size: 9px;
  font-weight: 750;
}

.hero h1 {
  color: #241e22;
  font-family: Inter, "Arial Black", "Segoe UI", sans-serif;
  font-weight: 850;
}

.hero h1 em {
  color: rgba(45, 37, 42, .52);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.hero-copy {
  color: rgba(45, 37, 42, .8);
  font-weight: 500;
}

.section-heading {
  border-color: rgba(45, 37, 42, .09);
}

.section-heading h2 {
  color: #292227;
}

.section-heading span {
  color: rgba(45, 37, 42, .72);
  font-size: 9px;
  font-weight: 700;
}

.admin-panel,
.meme-card {
  border-color: rgba(45, 37, 42, .09);
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 18px 45px rgba(82, 56, 68, .1);
}

.drop-zone,
.caption-field {
  border-color: rgba(45, 37, 42, .12);
  background: rgba(255, 255, 255, .4);
}

.drop-zone strong,
.caption-field input,
.admin-panel__heading strong {
  color: #2d252a;
}

.admin-panel__heading small {
  color: rgb(var(--rose-deep));
  font-size: 9px;
  font-weight: 800;
}

.drop-zone small,
.caption-field span,
.text-button {
  color: rgba(45, 37, 42, .78);
}

.drop-zone strong {
  font-size: 12px;
  font-weight: 750;
}

.drop-zone small,
.caption-field span {
  font-size: 10px;
}

.caption-field input::placeholder {
  color: rgba(45, 37, 42, .62);
}

.text-button {
  padding: 8px 11px;
  border: 1px solid rgba(45, 37, 42, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .42);
  font-size: 10px;
  font-weight: 800;
}

.text-button:hover {
  color: #fff;
  border-color: transparent;
  background: rgb(var(--rose-deep));
}

.admin-panel__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.paste-button {
  color: #fff;
  border-color: transparent;
  background: rgb(var(--rose-deep));
  box-shadow: 0 7px 18px rgba(126, 52, 79, .17);
}

.upload-button,
.login-dialog form button {
  color: #fff;
  background: linear-gradient(135deg, #713247, #c65d82);
  box-shadow: 0 12px 28px rgba(126, 52, 79, .25);
  font-size: 10px;
  font-weight: 800;
  text-shadow: 0 1px 1px rgba(45, 18, 28, .18);
}

.upload-button:hover,
.login-dialog form button:hover {
  box-shadow: 0 15px 34px rgba(126, 52, 79, .34);
}

.meme-card__meta p {
  color: rgba(45, 37, 42, .86);
  font-size: 13px;
  font-weight: 600;
}

.meme-card__meta time,
.delete-button {
  color: rgba(45, 37, 42, .7);
}

.meme-card__meta time,
.delete-button {
  font-size: 9px;
}

.empty-state,
.server-notice {
  color: rgba(45, 37, 42, .76);
  border-color: rgba(45, 37, 42, .13);
  background: rgba(255, 255, 255, .25);
}

.empty-state p,
.server-notice strong {
  color: rgba(45, 37, 42, .86);
}

.empty-state small,
.server-notice p {
  color: rgba(45, 37, 42, .74);
}

.site-footer {
  color: rgba(45, 37, 42, .7);
  border-color: rgba(45, 37, 42, .08);
}

.login-dialog {
  color: #292227;
  border: 1px solid rgba(45, 37, 42, .1);
  background:
    radial-gradient(circle at 100% 0, rgba(211, 125, 150, .2), transparent 42%),
    rgba(250, 247, 245, .98);
  box-shadow: 0 35px 100px rgba(82, 56, 68, .28);
}

.login-dialog::backdrop {
  background: rgba(45, 37, 42, .32);
  backdrop-filter: blur(9px);
}

.dialog-close {
  color: rgba(45, 37, 42, .62);
}

.dialog-close:hover {
  color: rgb(var(--rose-deep));
}

.login-dialog h2 {
  color: #241e22;
}

.login-dialog > p:not(.eyebrow) {
  color: rgba(45, 37, 42, .8);
  font-size: 12px;
}

.login-dialog form label span {
  color: rgba(45, 37, 42, .82);
  font-size: 10px;
  font-weight: 700;
}

.login-dialog form input {
  color: #292227;
  border-color: rgba(45, 37, 42, .16);
  background: rgba(255, 255, 255, .72);
  font-size: 14px;
}

.login-dialog form input:focus {
  border-color: rgba(152, 65, 95, .65);
  box-shadow: 0 0 0 3px rgba(193, 93, 125, .12);
}

.form-message {
  color: #a52d54;
  font-size: 10px;
  font-weight: 650;
}

.toast {
  color: #fff;
  border-color: rgba(255, 255, 255, .16);
  background: rgba(37, 29, 34, .96);
  box-shadow: 0 14px 38px rgba(55, 35, 44, .28);
  font-size: 10px;
  font-weight: 650;
}

.meme-card__open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  color: inherit;
  border: 0;
  background: #171316;
  cursor: zoom-in;
}

.meme-card__open::after {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: rgba(28, 22, 26, .58);
  backdrop-filter: blur(10px);
  content: "развернуть";
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .08em;
  opacity: 0;
  text-transform: uppercase;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s;
}

.meme-card__open img,
.meme-card__open video {
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .2s;
}

.meme-card__open:hover::after,
.meme-card__open:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.meme-card__open:hover img,
.meme-card__open:hover video {
  opacity: .9;
  transform: scale(1.018);
}

.meme-card__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.share-button,
.delete-button {
  padding: 5px 0;
  color: rgba(45, 37, 42, .76);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color .2s;
}

.share-button:hover,
.share-button:focus-visible {
  color: rgb(var(--rose-deep));
}

.meme-viewer {
  width: min(calc(100% - 28px), 1120px);
  max-width: 1120px;
  height: min(calc(100% - 28px), 900px);
  max-height: 900px;
  padding: 0;
  overflow: hidden;
  color: #292227;
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 24px;
  outline: 0;
  background: rgba(248, 244, 242, .98);
  box-shadow: 0 40px 120px rgba(45, 27, 36, .42);
}

.meme-viewer::backdrop {
  background: rgba(31, 25, 29, .76);
  backdrop-filter: blur(12px);
}

.meme-viewer[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.meme-viewer__media {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #30272c, #171316 72%);
}

.meme-viewer__media img,
.meme-viewer__media video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 145px);
  object-fit: contain;
}

.meme-viewer__meta {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  border-top: 1px solid rgba(45, 37, 42, .09);
}

.meme-viewer__meta p {
  margin: 0;
  color: #292227;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.35;
}

.meme-viewer__meta time {
  display: block;
  margin-top: 5px;
  color: rgba(45, 37, 42, .58);
  font-family: Consolas, monospace;
  font-size: 9px;
}

.viewer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(28, 22, 26, .58);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
  transition: background-color .2s, transform .2s;
}

.viewer-close:hover {
  background: rgb(var(--rose-deep));
  transform: rotate(4deg);
}

.share-button--viewer {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #713247, #c65d82);
  box-shadow: 0 8px 20px rgba(126, 52, 79, .22);
}

.share-button--viewer:hover,
.share-button--viewer:focus-visible {
  color: #fff;
}

@media (max-width: 620px) {
  .admin-panel__heading {
    align-items: flex-start;
    gap: 14px;
  }

  .admin-panel__actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .meme-card__open::after {
    opacity: 1;
    transform: none;
  }

  .meme-viewer {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .meme-viewer__media img,
  .meme-viewer__media video {
    max-height: calc(100vh - 84px);
  }

  .meme-viewer__meta {
    min-height: 84px;
    padding: 12px 15px;
  }

  .share-button--viewer {
    padding: 9px 11px;
    font-size: 8px;
  }
}
