:root {
  --bg: #0f1226;
  --card: #1a1d3a;
  --accent: #3ddc84;
  --accent-hover: #5fe89d;
  --text: #e8eaf6;
  --muted: #9aa0c3;
  --border: #2a2f55;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #0f1226 0%, #1a1d3a 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem 1rem;
}

main {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.hero h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.6rem;
}

.welcome {
  margin: 0 0 0.5rem 0;
  color: var(--muted);
  font-style: italic;
}

.visits {
  margin: 0;
  color: var(--muted);
}

.visits strong {
  color: var(--accent);
  font-size: 1.2rem;
}

.avatar-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  background: var(--bg);
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
}

h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.15rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.75rem 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#msg-form {
  margin-bottom: 1rem;
}

input[type="text"], textarea, input[type="file"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

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

input[type="file"] {
  padding: 0.5rem;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s;
}

button:hover {
  background: var(--accent-hover);
}

.status {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 0 0;
  min-height: 1em;
}

.status.error { color: #ff7c7c; }
.status.ok { color: #7cff9b; }

ul#messages {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#messages li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

#messages .author {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

#messages .time {
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

#messages .body {
  margin: 0.25rem 0 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

#messages .empty {
  color: var(--muted);
  text-align: center;
  font-style: italic;
  padding: 1rem;
}
