body {
  overflow: hidden;
}

.screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.screen-head {
  padding-top: 18px;
}

.screen-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 18px;
  height: calc(100vh - 122px);
  padding: 18px 250px 140px 0;
}

.message-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: 18px;
  overflow: hidden;
  position: relative;
  animation: cardIn 260ms ease;
}

.message-card.has-image {
  grid-template-columns: 120px 1fr;
  grid-template-rows: auto 1fr auto;
  column-gap: 16px;
}

.message-card img {
  width: 120px;
  height: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  grid-row: 1 / span 3;
}

.message-card .name {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.message-card .text {
  font-size: clamp(1rem, 1.3vw, 1.35rem);
  line-height: 1.35;
  color: #eef2ff;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}

.message-card .time {
  color: var(--muted);
  font-size: 0.9rem;
}

.placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.qr-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  pointer-events: none;
}

.qr-card {
  width: 200px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(10, 10, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.qr-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  background: #fff;
}

.qr-copy {
  padding-top: 10px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.qr-copy strong {
  font-size: 1rem;
  color: #fff;
}

.qr-copy span {
  font-size: 0.88rem;
  color: var(--muted);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
    padding-right: 230px;
    padding-bottom: 140px;
  }
}
