:root {
  --bg: #101014;
  --panel: #f2eadf;
  --ink: #171514;
  --muted: #665f58;
  --line: #241c16;
  --accent: #d04a24;
  --accent-dark: #7d2114;
  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-soft: rgba(0, 0, 0, 0.3);
  --glow-red: rgba(208, 74, 36, 0.26);
  --glow-gold: rgba(248, 204, 120, 0.16);
  --bg-a: #171217;
  --bg-b: #0f1014;
  --bg-c: #1b1410;
  --paper-light: #fff8ed;
  --paper-input: #fffaf2;
  --paper-entry: #fff7e8;
  --paper-stripe-a: #f4dfc6;
  --paper-stripe-b: #e8cbaa;
  --gold: #f6d89c;
  --subtitle: #c8b8aa;
  --white: #ffffff;
  --line-faint: rgba(36, 28, 22, 0.45);
  --placeholder: rgba(36, 28, 22, 0.5);
  --counter-border: rgba(246, 216, 156, 0.42);
  --counter-bg: rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, var(--glow-red), transparent 28%),
    radial-gradient(circle at 80% 15%, var(--glow-gold), transparent 30%),
    linear-gradient(145deg, var(--bg-a) 0%, var(--bg-b) 52%, var(--bg-c) 100%);
  color: var(--panel);
  font-family:
    ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Nanum Gothic Coding",
    monospace;
  padding: 34px 16px 52px;
}

main {
  width: min(980px, 100%);
  margin: 0 auto;
  min-width: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 70px);
  line-height: 0.9;
  letter-spacing: -0.08em;
  overflow-wrap: anywhere;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--subtitle);
  font-size: 14px;
}

.counter {
  color: var(--gold);
  border: 1px solid var(--counter-border);
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--counter-bg);
  white-space: nowrap;
}

.composer {
  background: var(--panel);
  color: var(--ink);
  border: 3px solid var(--line);
  box-shadow: 10px 10px 0 var(--shadow);
  padding: 16px;
  margin-bottom: 28px;
}

.composer-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
}

.image-picker {
  min-height: 180px;
  border: 2px dashed var(--line-faint);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--paper-light);
}

.image-picker img {
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  display: none;
}

.image-picker span {
  color: var(--muted);
  text-align: center;
  padding: 12px;
  font-size: 13px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--accent-dark);
}

input,
textarea,
button {
  font: inherit;
}

input[type="text"],
textarea {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--paper-input);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

input[type="file"] {
  width: 100%;
  color: var(--muted);
}

textarea {
  min-height: 118px;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

button {
  border: 2px solid var(--line);
  background: var(--accent);
  color: var(--white);
  font-weight: 900;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--line);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status {
  color: var(--muted);
  font-size: 13px;
}

.status.is-danger {
  color: var(--accent-dark);
}

.entries {
  display: grid;
  gap: 12px;
}

.entry {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 112px;
  background: var(--paper-entry);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow-soft);
  padding: 10px;
}

.entry-image {
  width: 92px;
  height: 92px;
  border: 2px solid var(--line);
  background: repeating-linear-gradient(45deg, var(--paper-stripe-a) 0 8px, var(--paper-stripe-b) 8px 16px);
  object-fit: contain;
}

.entry-placeholder {
  display: grid;
  place-items: center;
  color: var(--placeholder);
  font-size: 12px;
}

.entry-nickname {
  font-weight: 900;
  font-size: 17px;
  color: var(--accent-dark);
  margin: 2px 0 7px;
  overflow-wrap: anywhere;
}

.entry-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.52;
}

.entry-time {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.entry-reply {
  margin-top: 10px;
  border-left: 4px solid var(--accent);
  padding: 8px 10px;
  background: var(--paper-light);
}

.entry-reply-label {
  color: var(--accent-dark);
  font-weight: 900;
  margin-bottom: 4px;
}

@media (max-width: 680px) {
  body {
    padding: 22px 10px 36px;
  }

  header,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .image-picker {
    min-height: 150px;
  }

  .entry {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 92px;
  }

  .entry-image {
    width: 72px;
    height: 72px;
  }
}
