* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 10px;
  font-family: "Courier New", Courier, monospace;
  background: #d8d0c0;
  color: #000;
  font-size: 15px;
  line-height: 1.4;
  -webkit-tap-highlight-color: rgba(0, 0, 128, 0.2);
}

a {
  color: #0000ee;
  word-break: break-word;
}
a:visited {
  color: #551a8b;
}

h1, h2, h3 {
  font-family: "Times New Roman", Times, serif;
  margin: 0 0 8px 0;
  word-wrap: break-word;
}

h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

.box {
  border: 2px ridge #888;
  background: #fffbe6;
  padding: 10px;
  margin: 0 0 10px 0;
}

.header {
  text-align: center;
  background: #000080;
  color: #ffff00;
  padding: 10px 6px;
  border: 3px ridge #ccc;
  margin-bottom: 10px;
}

.header h1 {
  margin: 0;
  letter-spacing: 2px;
  font-size: 22px;
  color: #ffff00;
  text-shadow: 2px 2px 0 #000;
}

.search-box {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 2px inset #888;
  font-family: inherit;
  font-size: 16px;
}

.search-box button {
  white-space: nowrap;
}

.nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  background: #c0c0c0;
  border: 2px outset #999;
  padding: 8px;
  margin-bottom: 10px;
}

.nav-left, .nav-right {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 100%;
}

.nav a {
  background: #e0e0e0;
  border: 2px outset #aaa;
  padding: 8px 10px;
  text-decoration: none;
  color: #000;
  font-weight: bold;
  font-size: 13px;
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
}

.nav a:hover {
  background: #f0f0f0;
}

.nav a:active {
  border-style: inset;
}

button, input[type="submit"] {
  background: #c0c0c0;
  border: 2px outset #999;
  padding: 8px 12px;
  font-family: inherit;
  cursor: pointer;
  font-size: 14px;
  min-height: 36px;
}

button:active, input[type="submit"]:active {
  border-style: inset;
}

button:hover {
  background: #d8d8d8;
}

input[type="text"], input[type="password"], textarea, input[type="color"], input[type="file"] {
  font-family: inherit;
  border: 2px inset #888;
  padding: 8px;
  background: #fff;
  font-size: 16px;
  max-width: 100%;
}

textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
}

.form-row {
  margin-bottom: 10px;
}

.form-row label {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 13px;
}

.form-row input[type="text"],
.form-row input[type="password"] {
  width: 100%;
}

.feed-item {
  border: 2px ridge #888;
  background: #fff;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.feed-item:hover, .feed-item:active {
  background: #ffffd0;
}

.tag {
  display: inline-block;
  background: #000080;
  color: #ffff00;
  font-size: 11px;
  padding: 3px 6px;
  margin-right: 6px;
  margin-bottom: 4px;
  font-weight: bold;
}

.user-bar {
  background: #000;
  color: #0f0;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 2px ridge #555;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

.user-bar a {
  color: #0ff;
}

.notif-panel {
  position: fixed;
  top: 44px;
  right: 10px;
  min-width: 220px;
  background: #111;
  border: 2px ridge #555;
  color: #eee;
  padding: 10px 12px;
  z-index: 999;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}

.notif-panel button {
  margin-top: 6px;
  font-size: 11px;
  padding: 4px 10px;
}

.list-item {
  border: 2px ridge #888;
  background: #fffbe6;
  padding: 10px;
  margin-bottom: 10px;
  word-wrap: break-word;
}

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

.reactions button {
  margin-right: 0;
  flex: 0 0 auto;
}

.poll-bar {
  background: #ddd;
  border: 1px inset #888;
  height: 22px;
  margin: 4px 0;
  position: relative;
  overflow: hidden;
}

.poll-bar .fill {
  background: #0000aa;
  height: 100%;
}

.poll-bar.highest .fill {
  background: #008000;
}

.poll-bar .label {
  position: absolute;
  left: 6px;
  top: 0;
  right: 6px;
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-card {
  border: 2px ridge #888;
  background: #fffbe6;
  padding: 10px;
  margin-bottom: 10px;
}

.page-card a {
  font-weight: bold;
  font-size: 16px;
}

.chat-window {
  border: 2px inset #888;
  background: #fff;
  padding: 8px;
  height: 300px;
  overflow-y: auto;
  margin-bottom: 8px;
  font-size: 14px;
  -webkit-overflow-scrolling: touch;
}

.chat-msg {
  padding: 6px 4px;
  border-bottom: 1px dashed #ccc;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.chat-msg .who {
  color: #0000aa;
  font-weight: bold;
}

.chat-msg .meta {
  font-size: 10px;
  color: #777;
  margin-left: 6px;
  display: inline-block;
}

.chat-msg .actions {
  float: right;
}

.chat-msg .actions button {
  font-size: 11px;
  padding: 4px 6px;
  min-height: 28px;
}

.dm-list {
  border: 2px ridge #888;
  background: #fff;
  padding: 6px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dm-list .user {
  padding: 10px 8px;
  cursor: pointer;
  border-bottom: 1px dashed #ccc;
  font-size: 14px;
}

.dm-list .user:hover, .dm-list .user:active {
  background: #ffffd0;
}

.dm-list .user.active {
  background: #000080;
  color: #ffff00;
}

.error {
  color: #c00;
  background: #ffe0e0;
  padding: 8px;
  border: 1px solid #c00;
  margin-bottom: 8px;
  font-size: 13px;
}

.success {
  color: #060;
  background: #e0ffe0;
  padding: 8px;
  border: 1px solid #060;
  margin-bottom: 8px;
  font-size: 13px;
}

.empty {
  text-align: center;
  padding: 18px 10px;
  color: #555;
  font-style: italic;
  font-size: 13px;
}

img.preview {
  max-width: 100%;
  max-height: 300px;
  display: block;
  margin: 6px 0;
  border: 2px ridge #888;
  height: auto;
}

.comment {
  background: #f5f5f5;
  border: 1px solid #ccc;
  padding: 6px;
  margin: 4px 0;
  font-size: 13px;
  word-wrap: break-word;
}

.comment .who {
  font-weight: bold;
  color: #0000aa;
}

.page-bg {
  min-height: 200px;
  padding: 14px;
  border: 2px ridge #888;
  background-size: cover;
  background-position: center;
  margin-bottom: 10px;
}

marquee {
  background: #ffff00;
  color: #c00;
  font-weight: bold;
  border: 2px ridge #888;
  padding: 4px;
  margin-bottom: 10px;
  font-size: 13px;
}

.footer {
  text-align: center;
  font-size: 11px;
  color: #555;
  margin-top: 16px;
  padding: 8px;
  border-top: 2px ridge #888;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ── Video cards ─────────────────────────────────── */
.video-card {
  border: 2px ridge #888;
  background: #fffbe6;
  margin-bottom: 14px;
  overflow: hidden;
}
.video-meta {
  padding: 8px 10px 6px;
}
.video-actions {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid #ccc;
  background: #f0ecdc;
}

/* ── Profile ─────────────────────────────────────── */
.profile-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.profile-photo {
  width: 68px;
  height: 68px;
  border: 2px outset #999;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.profile-photo-placeholder {
  width: 68px;
  height: 68px;
  border: 2px outset #999;
  background: #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.profile-stats {
  display: flex;
  gap: 18px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.profile-stat {
  text-align: center;
  cursor: pointer;
  min-width: 48px;
}
.profile-stat b {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}
.profile-stat span {
  font-size: 11px;
  color: #555;
}

/* ── Notification badge ──────────────────────────── */
.notif-badge {
  background: #cc0000;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  position: absolute;
  top: -4px;
  right: -6px;
  pointer-events: none;
}

/* ── Feed item type colours ──────────────────────── */
.feed-item.video-item {
  border-left: 4px solid #0000bb;
}
.feed-item.opinion-item {
  border-left: 4px solid #007700;
}
.feed-item.poll-item {
  border-left: 4px solid #886600;
}

/* ── DM chat bubbles ─────────────────────────────── */
.dm-bubble {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}
.dm-bubble.mine {
  align-items: flex-end;
}
.dm-bubble.theirs {
  align-items: flex-start;
}
.dm-msg {
  padding: 6px 10px;
  word-break: break-word;
  max-width: 80%;
  border: 2px outset #aaa;
}
.dm-bubble.mine .dm-msg {
  background: #0000cc;
  color: #fff;
  border-color: #0000aa;
}
.dm-bubble.theirs .dm-msg {
  background: #e4e0d0;
  color: #000;
}
.dm-meta {
  font-size: 11px;
  color: #555;
  margin-bottom: 2px;
}
.dm-time {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}

/* tablet+ */
@media (min-width: 700px) {
  body {
    padding: 16px;
    font-size: 14px;
  }
  .header h1 {
    font-size: 28px;
    letter-spacing: 4px;
  }
  .nav-left, .nav-right {
    flex: 0 0 auto;
  }
  .nav a {
    flex: 0 0 auto;
    padding: 4px 8px;
  }
  .two-col {
    grid-template-columns: 1fr 2fr;
  }
  .chat-window {
    height: 360px;
  }
  button, input[type="submit"] {
    padding: 4px 10px;
    min-height: 0;
    font-size: 13px;
  }
  input[type="text"], input[type="password"], textarea {
    font-size: 14px;
    padding: 4px;
  }
}

/* ═══════════════════════════════════════════════════
   Comeback Update — new styles
   ═══════════════════════════════════════════════════ */

/* Blue verification tick */
.blue-tick { color: #1da1f2; font-size: 13px; display: inline-block; margin-left: 2px; }

/* Active status dot */
.active-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 4px; vertical-align: middle; }
.active-status { font-size: 11px; color: #444; }
.active-status.online { color: #16a34a; }

/* ── DM user list cards ──────────────────────────── */
.dm-user-card {
  display: flex; gap: 10px; align-items: flex-start;
  border: 2px ridge #888; background: #fffbe6;
  padding: 10px; margin-bottom: 8px; cursor: pointer;
  transition: background .1s;
}
.dm-user-card:hover { background: #fff8d0; }
.dm-user-card .card-pic {
  width: 44px; height: 44px; border: 2px solid #aaa; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; background: #c0c0c0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  overflow: hidden;
}
.dm-user-card .card-pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dm-users-scroll { max-height: 460px; overflow-y: auto; border: 2px inset #888; background: #fffbe6; padding: 6px 8px; }
.dm-user-card .card-info { flex: 1; min-width: 0; }
.dm-user-card .card-name { font-weight: bold; font-size: 14px; word-break: break-word; }
.dm-user-card .card-bio { font-size: 12px; color: #555; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-user-card .card-status { font-size: 11px; margin-top: 3px; color: #777; }
.dm-user-card.mutual-follow { border-color: #0000aa; }

/* ── Full-screen DM chat ─────────────────────────── */
.fullchat-wrap {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: #d8d0c0; z-index: 10;
}
.fullchat-header {
  background: #000080; color: #fff;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; border-bottom: 3px ridge #4444aa;
}
.fullchat-header .hd-pic {
  width: 38px; height: 38px; border: 2px ridge #8888cc;
  background: #555; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.fullchat-header .hd-pic img { width: 100%; height: 100%; object-fit: cover; }
.fullchat-msgs {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.fullchat-bubble {
  max-width: 75%; padding: 8px 12px;
  border: 2px outset #aaa; word-break: break-word;
  font-size: 14px;
}
.fullchat-bubble.mine {
  align-self: flex-end; background: #000080; color: #fff; border-color: #0000aa;
}
.fullchat-bubble.theirs {
  align-self: flex-start; background: #fffbe6; color: #000;
}
.fullchat-bubble .b-time { font-size: 10px; opacity: .65; margin-top: 3px; }
.fullchat-bubble.mine .b-time { text-align: right; }
.fullchat-reactions {
  display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px;
}
.fullchat-reactions button {
  font-size: 11px; padding: 1px 6px; min-height: 0; background: #e8e4d0; border: 1px solid #aaa;
}
.fullchat-input-row {
  display: flex; gap: 6px; padding: 8px 10px;
  background: #c0c0c0; border-top: 2px ridge #888; flex-shrink: 0;
}
.fullchat-input-row input { flex: 1; min-width: 0; }
.typing-hint { font-size: 11px; color: #666; padding: 2px 10px; background: #d8d0c0; }
.fc-back-btn {
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 20px; padding: 0; min-height: 0; line-height: 1;
}

/* ── Anonymous comments ──────────────────────────── */
.anon-comment {
  background: #f0ece0; border-left: 3px solid #888;
  padding: 7px 10px; margin: 5px 0; font-size: 13px;
}
.anon-comment .c-meta { font-size: 10px; color: #888; margin-top: 3px; }
.anon-reply {
  background: #e8e4d8; border-left: 2px solid #aaa;
  padding: 5px 8px; margin: 4px 0 0 16px; font-size: 12px;
}
.anon-reply .c-meta { font-size: 10px; color: #888; }
.reply-toggle { font-size: 11px; color: #0000aa; cursor: pointer; background: none; border: none; padding: 2px 0; min-height: 0; text-decoration: underline; }
.comment-input-row { display: flex; gap: 6px; margin-top: 8px; }
.comment-input-row input { flex: 1; font-size: 13px; padding: 5px 8px; border: 2px inset #888; font-family: inherit; }
.comment-count-btn {
  background: #e0dcd0; border: 2px outset #aaa; font-size: 12px; padding: 4px 10px; cursor: pointer; min-height: 0;
}

/* ── Admin panel ─────────────────────────────────── */
.admin-section { border: 2px ridge #888; background: #fffbe6; padding: 10px; margin-bottom: 10px; }
.admin-section h3 { margin: 0 0 8px 0; font-size: 15px; border-bottom: 1px dashed #888; padding-bottom: 4px; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.admin-stat { border: 2px inset #999; background: #f5f5e8; padding: 8px; text-align: center; }
.admin-stat b { display: block; font-size: 22px; color: #000080; }
.admin-stat span { font-size: 11px; color: #555; }
.admin-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #ccc; font-size: 13px; word-break: break-word; }
.admin-item:last-child { border-bottom: none; }
.admin-del-btn { background: #880000; color: #fff; border-color: #660000; font-size: 11px; padding: 3px 8px; min-height: 0; flex-shrink: 0; }

/* ── Truth & Dare ─────────────────────────────────── */
.td-choice { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.td-btn-truth {
  flex: 1; min-width: 120px; background: #000080; color: #ffff00;
  border: 3px outset #4444aa; font-size: 18px; font-weight: bold; padding: 18px 10px;
  cursor: pointer; font-family: inherit; text-align: center;
}
.td-btn-dare {
  flex: 1; min-width: 120px; background: #880000; color: #fff;
  border: 3px outset #aa4444; font-size: 18px; font-weight: bold; padding: 18px 10px;
  cursor: pointer; font-family: inherit; text-align: center;
}
.td-btn-truth:active, .td-btn-dare:active { border-style: inset; }
.td-result-box { margin-top: 14px; border: 3px ridge; padding: 16px; display: none; }
.td-result-box.truth { border-color: #0000aa; background: #e8eeff; }
.td-result-box.dare { border-color: #c00000; background: #ffe8e8; }
.td-result-label { font-size: 11px; font-weight: bold; letter-spacing: 2px; margin-bottom: 8px; }
.td-result-text { font-size: 19px; font-weight: bold; font-family: 'Times New Roman', serif; }

/* ── Daily popup overlay ─────────────────────────── */
.popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.popup-box {
  background: #fffbe6; border: 4px ridge #888; padding: 20px 24px; max-width: 340px; width: 90%; text-align: center;
}
.popup-box h2 { color: #000080; margin-top: 0; }
.popup-btns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.popup-btns .play-btn { background: #000080; color: #ffff00; border: 2px outset #4444aa; font-size: 15px; padding: 10px 22px; font-family: inherit; cursor: pointer; font-weight: bold; }
.popup-btns .skip-btn { background: #c0c0c0; border: 2px outset #999; font-size: 15px; padding: 10px 22px; font-family: inherit; cursor: pointer; }

/* ── Chat improved ───────────────────────────────── */
.chat-msg-row {
  display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; border-bottom: 1px dashed #ccc; word-break: break-word;
}
.chat-msg-row .cmr-pic {
  width: 32px; height: 32px; border: 2px solid #aaa; border-radius: 50%; flex-shrink: 0;
  background: #c0c0c0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.chat-msg-row .cmr-pic a { display: block; width: 100%; height: 100%; }
.chat-msg-row .cmr-pic img { width: 100%; height: 100%; object-fit: cover; }
.chat-msg-row .cmr-body { flex: 1; min-width: 0; }
.chat-msg-row .cmr-header { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 2px; }
.chat-msg-row .cmr-text { font-size: 14px; }
.chat-msg-row .cmr-meta { font-size: 10px; color: #777; margin-top: 2px; }
.chat-msg-row .cmr-reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.chat-msg-row .cmr-reactions button { font-size: 11px; padding: 1px 5px; min-height: 0; background: #e8e4d0; border: 1px solid #aaa; }
.chat-msg-row .cmr-actions { display: flex; gap: 4px; }
.chat-msg-row .cmr-actions button { font-size: 11px; padding: 2px 6px; min-height: 0; }
.chat-window-new {
  border: 2px inset #888; background: #fff; padding: 0;
  min-height: 380px; max-height: 520px; overflow-y: auto; margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 480px) {
  .chat-window-new { max-height: 62vh; }
  .fullchat-bubble { max-width: 88%; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
