:root {
  --bg: #0f172a;
  --text: #eff4ff;
  --caret: #a5adff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% -10%, #1b2852 0%, var(--bg) 52%);
}

body {
  min-height: 100vh;
  padding: clamp(0.4rem, 1.1vw, 1rem);
}

.message-shell {
  min-height: calc(100vh - clamp(2rem, 6vw, 5rem));
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-text {
  width: 100%;
  color: var(--text);
  text-align: center;
  font-family: "Cascadia Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(2rem, 7vw, 6.2rem);
  line-height: 1.12;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-line {
  margin: 0;
}

.message-figure {
  width: 100%;
  height: calc(100vh - clamp(2rem, 6vw, 5rem));
  margin: 0;
  display: grid;
  place-items: center;
}

.message-image {
  width: min(98vw, 2200px);
  height: min(96vh, 1500px);
  object-fit: contain;
  border-radius: 0.7rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.message-file {
  width: min(96vw, 1100px);
  padding: clamp(1rem, 3vw, 2.2rem);
  border: 1px solid #41508a;
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(27, 40, 82, 0.9), rgba(15, 23, 42, 0.95));
  color: var(--text);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.message-file-name {
  margin: 0;
  font-family: "Cascadia Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(1.25rem, 2.7vw, 2.4rem);
  line-height: 1.2;
  word-break: break-word;
}

.message-file-meta {
  margin: clamp(0.6rem, 1.6vw, 1rem) 0 0;
  color: #d9e3ff;
  font-family: "Cascadia Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(0.95rem, 1.8vw, 1.25rem);
}

.message-file-download {
  margin-top: clamp(0.85rem, 2vw, 1.3rem);
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 0.65rem;
  border: 1px solid #6d7fca;
  background: #24387e;
  color: #f6f8ff;
  text-decoration: none;
  font-family: "Cascadia Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
}

.message-file-download:hover,
.message-file-download:focus-visible {
  background: #2f49a4;
}

.typing-caret::after {
  content: "▋";
  margin-left: 2px;
  color: var(--caret);
  animation: caret 0.8s steps(1, end) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}
