:root {
  --bg: #0d1117;
  --card-bg: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --link: #58a6ff;
  --accent: #238636;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

header {
  padding: 20px 0 30px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

h1 a {
  color: var(--text);
  text-decoration: none;
}

h1 a:hover {
  color: var(--link);
}

h1 span { color: var(--text-muted); font-weight: 400; }

.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 5px;
}

.accounts {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.85rem;
}

.accounts a {
  color: var(--link);
  text-decoration: none;
}

.accounts a:hover { text-decoration: underline; }

.back-link {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 10px;
}

.back-link:hover {
  text-decoration: underline;
}

/* Profile card */

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.profile-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.profile-handle {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.profile-bio {
  margin-top: 12px;
  white-space: pre-wrap;
}

.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

/* Tweet card */

.tweet {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.tweet-body {
  display: flex;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tweet-content {
  flex: 1;
  min-width: 0;
}

.tweet-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.author {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.author:hover {
  text-decoration: underline;
}

a.handle {
  text-decoration: none;
}

a.handle:hover {
  text-decoration: underline;
}

.handle, .date {
  color: var(--text-muted);
}

a.date {
  text-decoration: none;
}

a.date:hover {
  text-decoration: underline;
}

.retweet-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
  padding-left: 60px;
}

.tweet-text {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.tweet-text a {
  color: var(--link);
  text-decoration: none;
}

.tweet-text a:hover {
  text-decoration: underline;
}

.tweet-media {
  margin-top: 12px;
  display: grid;
  gap: 4px;
  border-radius: 12px;
  overflow: hidden;
}

.tweet-media img,
.tweet-media video {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #000;
}

.tweet-media img {
  cursor: pointer;
  transition: opacity 0.2s;
}

.tweet-media img:hover {
  opacity: 0.85;
}

.stats {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  gap: 16px;
}

.no-tweets {
  color: var(--text-muted);
  font-style: italic;
  padding: 20px 0;
}

/* Quoted tweet */

a.quoted-tweet {
  display: block;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: inherit;
  text-decoration: none;
}

a.quoted-tweet:hover {
  border-color: var(--text-muted);
}

.quoted-tweet .quoted-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.quoted-tweet .quoted-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.quoted-tweet .quoted-author {
  font-weight: 600;
  color: var(--text);
}

.quoted-tweet .quoted-handle {
  color: var(--text-muted);
}

.quoted-tweet .quoted-text {
  font-size: 0.9rem;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.quoted-text a {
  color: var(--link);
  text-decoration: none;
}

.quoted-text a:hover {
  text-decoration: underline;
}

.quoted-media {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
}

.quoted-media img,
.quoted-media video {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

/* Image modal */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-muted);
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  padding: 20px;
  user-select: none;
}

.modal-nav:hover {
  color: var(--text-muted);
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }

footer {
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}
