:root {
  --bg: #0f0f12;
  --card: #1a1a22;
  --border: #2e2e3a;
  --text: #f4f4f7;
  --muted: #9b9bb0;
  --accent: #ff4d6d;
  --accent-2: #ffc857;
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 77, 109, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(255, 200, 87, 0.08), transparent);
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 77, 109, 0.15);
  border: 1px solid rgba(255, 77, 109, 0.35);
  border-radius: 999px;
  color: #ff8fa3;
}

h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  line-height: 1.15;
  margin: 0 0 16px;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.lead strong {
  color: var(--text);
}

.timer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px 24px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.timer-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.deadline {
  margin: 8px 0 20px;
  font-weight: 600;
  color: var(--accent-2);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.unit {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 12px 4px;
}

.unit span {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

.unit small {
  display: block;
  margin-top: 4px;
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
}

.timer-done {
  margin: 16px 0 0;
  color: var(--accent);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.comments-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  margin: 0 0 6px;
}

.hint {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.field span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(255, 77, 109, 0.6);
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.photo-field {
  position: relative;
}

.photo-field input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.photo-btn {
  display: block;
  text-align: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.photo-name {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.preview {
  text-align: center;
}

.preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 12px;
  object-fit: contain;
  background: #000;
}

.link-btn {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px;
}

.submit {
  width: 100%;
  padding: 16px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f0f12;
  background: linear-gradient(135deg, var(--accent-2), #ff9f43);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-error {
  margin: 0;
  color: #ff8fa3;
  font-size: 0.9rem;
  text-align: center;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-list .loading,
.comment-list .empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.comment-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.comment-meta strong {
  font-size: 0.95rem;
}

.comment-meta time {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.comment-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-photo {
  display: block;
  width: 100%;
  margin-top: 12px;
  border-radius: 10px;
  max-height: 320px;
  object-fit: cover;
  background: #000;
}
