:root {
  --ink: #3c332c;
  --muted: #8d7d72;
  --line: #f0e2d4;
  --paper: #fffdf9;
  --accent: #ff8b5a;
  --accent-deep: #ef6d3a;
  --heart: #e85d75;
  --stage: #ffe8cf;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 15% 20%, #fff7c8 0 18%, transparent 19%),
    radial-gradient(circle at 85% 80%, #ffd0bf 0 22%, transparent 23%),
    var(--stage);
}

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

.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 16px;
}

.phone {
  position: relative;
  width: min(390px, 100%);
  height: min(780px, calc(100dvh - 88px));
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 36px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(120, 72, 36, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 12px;
  background: linear-gradient(#fff8ef, #fffdf9);
}

.top-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.brand {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tagline, .note, .count, .time, .place {
  margin: 0;
  color: var(--muted);
}

.tagline { font-size: 13px; }

.text-button, .ghost, .primary {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.text-button {
  background: #fff1e4;
  color: #c2653b;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

#feed {
  flex: 1;
  overflow: auto;
  padding: 4px 16px 20px;
}

.card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.card:first-child { border-top: 0; }

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 32px;
}

.card-head, .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.place {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
}

.message {
  margin: 8px 0 10px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.like, .icon-button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 2px;
  font-weight: 700;
  color: var(--muted);
}

.like.is-on { color: var(--heart); }

.heart-mark {
  font-size: 18px;
  line-height: 1;
}

.icon-button {
  color: #c8b8ab;
  font-size: 18px;
  line-height: 1;
}

.empty {
  margin: 48px 12px;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}

.primary:hover { background: var(--accent-deep); }

.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 51, 44, 0.28);
  z-index: 2;
}

.sheet[hidden] {
  display: none;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  max-height: 88%;
  overflow: hidden;
  margin: 0;
  padding: 10px 18px 16px;
  background: #fff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(60, 51, 44, 0.12);
}

.sheet-body {
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #ecdcca;
}

.sheet h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.sheet label, .sheet fieldset {
  display: block;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.sheet input, .sheet textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf5;
  font-weight: 500;
}

.sheet textarea { resize: none; }

.sheet fieldset {
  border: 0;
  padding: 0;
}

.sheet legend { padding: 0; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.choice { position: relative; }

.choice input {
  appearance: none;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 14px;
  background: #fff4ea;
  cursor: pointer;
}

.choice span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 22px;
  pointer-events: none;
}

.swatch span {
  border: 2px solid transparent;
}

.choice input:focus-visible + span,
.choice input:checked + span {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

.count { text-align: right; font-size: 12px; }

.form-error {
  margin: 0 0 8px;
  color: var(--heart);
  font-size: 13px;
  font-weight: 700;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 10px;
  background: #fff;
}

.ghost, .primary {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
}

.top .primary {
  padding: 8px 14px;
  font-size: 13px;
}

.ghost { background: #f6efe8; }

.primary { background: var(--accent); color: white; }

.note { font-size: 13px; }

@media (max-width: 480px) {
  .stage { padding: 0; gap: 0; }
  .phone {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }
  .note { display: none; }
}
