/* Logged-in pages in the classic 2016 style (home, avatar, friends, create,
   messages, forum). Loaded after classic.css. */

/* =====================================================================
   Shared pieces
   ===================================================================== */
.c-btn-red { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.c-btn-red:hover { background: #c45252; border-color: #c45252; }
.c-btn-sm { padding: 2px 8px; font-size: 13px; }
.c-burger {
  background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer;
  width: 32px; height: 32px; margin-left: -6px; flex: none;
}
.c-burger[hidden] { display: none; }

/* left sidebar */
.c-sidebar {
  position: fixed; top: var(--c-header-h); bottom: 0; left: 0; width: 175px; z-index: 40;
  background: #fff; box-shadow: 1px 0 4px rgba(25, 25, 25, 0.2); overflow-y: auto;
  padding: 8px 0; display: none;
}
.c-side-user {
  display: block; padding: 8px 16px 10px; font-weight: 700; color: var(--c-text);
  border-bottom: 1px solid var(--c-line); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis;
}
.c-sidebar ul { list-style: none; margin: 0; padding: 0; }
.c-sidebar li a { display: flex; align-items: center; gap: 10px; padding: 7px 16px; color: var(--c-text); font-size: 15px; }
.c-sidebar li a i { color: #8c8c8c; }
.c-sidebar li a:hover { background: #f2f2f2; text-decoration: none; }
.c-sidebar li a.active { color: var(--c-link); font-weight: 600; box-shadow: inset 3px 0 0 var(--c-link); }
.c-sidebar li a.active i { color: var(--c-link); }
.c-side-badge {
  margin-left: auto; background: var(--c-red); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; padding: 0 6px; line-height: 18px;
}
.c-side-badge[hidden] { display: none; }
@media (min-width: 1280px) {
  .c-has-sidebar .c-sidebar { display: block; }
  /* Centre the content in the space right of the sidebar */
  .c-has-sidebar .c-footer { margin-left: 175px; }
  .c-has-sidebar .c-main {
    width: calc(100% - 175px);
    margin-left: calc(175px + max(0px, (100% - 175px - 1000px) / 2));
    margin-right: 0;
  }
  .c-has-sidebar .c-main.wide { margin-left: calc(175px + max(0px, (100% - 175px - 1200px) / 2)); }
  .c-has-sidebar .c-burger { display: none; }
}
@media (max-width: 1279px) {
  .c-sidebar-open .c-sidebar { display: block; top: 0; z-index: 70; box-shadow: 2px 0 12px rgba(0, 0, 0, 0.35); }
  .c-sidebar-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 65; }
}

/* dialogs & toasts */
.c-modal-wrap {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.c-modal { background: #fff; border-radius: 3px; width: 100%; max-width: 420px; padding: 18px; box-shadow: var(--c-shadow); }
.c-modal h3 { margin: 0 0 10px; font-size: 22px; font-weight: 400; }
.c-modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.c-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90;
  background: #fff; border-left: 4px solid var(--c-green); box-shadow: var(--c-shadow);
  padding: 8px 16px; border-radius: 3px; font-weight: 600;
}
.c-toast.error { border-left-color: var(--c-red); }
.c-toast[hidden] { display: none; }

/* horizontal tabs (white bar, blue underline) */
.c-line-tabs { display: flex; background: #fff; box-shadow: var(--c-shadow); border-radius: 3px; margin-bottom: 12px; overflow-x: auto; }
.c-line-tabs a, .c-line-tabs button {
  flex: 1; text-align: center; padding: 10px 12px; color: var(--c-text); background: none; border: 0;
  border-bottom: 3px solid transparent; cursor: pointer; font-size: 15px; white-space: nowrap; font-family: inherit;
}
.c-line-tabs a:hover, .c-line-tabs button:hover { text-decoration: none; background: #f7f7f7; }
.c-line-tabs .active { border-bottom-color: var(--c-link); font-weight: 600; }
.c-count { color: var(--c-muted); font-weight: 400; }

/* forms */
.c-field { margin-bottom: 12px; }
.c-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.c-field .c-input, .c-field .c-select, .c-field textarea { width: 100%; }
.c-field textarea {
  border: 1px solid var(--c-faint); border-radius: 3px; padding: 8px 10px; min-height: 120px;
  font-family: inherit; font-size: 15px; resize: vertical; color: var(--c-text);
}
.c-field input[type="file"] { font-family: inherit; font-size: 14px; }
.c-field .c-hint { font-size: 12px; color: var(--c-muted); margin-top: 3px; }
.c-input:focus, .c-select:focus, .c-field textarea:focus { outline: 2px solid var(--c-link); outline-offset: -1px; }
.c-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.c-section-head a { font-size: 14px; }
.c-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c-faint); }
.c-dot.on { background: var(--c-green); }
.c-avatar-sm { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: #e8e8e8; flex: none; border: 1px solid var(--c-line); }
.c-avatar-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =====================================================================
   Home
   ===================================================================== */
.c-hello { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.c-hello .c-avatar-circle { width: 120px; height: 120px; background: #fff; }
.c-hello h1 { font-size: 36px; font-weight: 400; margin: 0; word-break: break-word; }
.c-friend-strip { display: flex; gap: 14px; overflow-x: auto; padding: 14px 16px; }
.c-friend-strip .c-friend { flex: 0 0 84px; position: relative; }
.c-friend .c-dot { position: absolute; top: 50px; left: 58px; border: 2px solid #fff; width: 13px; height: 13px; }
.c-status-box { display: flex; gap: 8px; padding: 14px 16px 8px; }
.c-status-box .c-input { flex: 1; min-width: 0; }
.c-status-current { padding: 0 16px 14px; color: var(--c-muted); word-break: break-word; font-size: 14px; }

/* =====================================================================
   Avatar editor
   ===================================================================== */
.c-av { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.c-av-preview { padding: 16px; text-align: center; }
.c-av-preview .c-av-image { height: 300px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; border-radius: 3px; }
.c-av-preview .c-av-image img { width: 100%; height: 100%; object-fit: contain; }
.c-av-preview p { font-size: 13px; color: var(--c-muted); margin: 10px 0 0; }
.c-av-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 12px; }
.c-av-item {
  position: relative; background: #fff; border: 1px solid var(--c-line); border-radius: 3px; padding: 0;
  cursor: pointer; text-align: left; font-family: inherit; font-size: inherit; color: var(--c-text);
}
.c-av-item:hover { box-shadow: 0 2px 8px rgba(25, 25, 25, 0.3); }
.c-av-item:focus-visible { outline: 2px solid var(--c-link); }
.c-av-item .c-item-thumb { border-radius: 3px 3px 0 0; }
.c-av-item .c-item-name { padding: 5px 7px 7px; font-size: 13px; }
.c-av-item .c-worn {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 3px;
  background: #fff; border: 1px solid var(--c-faint); color: transparent;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.c-av-item.worn { border-color: var(--c-green); box-shadow: 0 0 0 1px var(--c-green); }
.c-av-item.worn .c-worn { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.c-av-pager { display: flex; justify-content: center; gap: 8px; padding: 0 12px 12px; }

/* =====================================================================
   Friends
   ===================================================================== */
.c-friend-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.c-friend-card { padding: 16px 12px; text-align: center; }
.c-friend-card .c-avatar-circle { width: 96px; height: 96px; margin: 0 auto 8px; }
.c-friend-card .c-fc-name { font-weight: 600; font-size: 16px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-friend-card .c-fc-status { font-size: 13px; color: var(--c-muted); margin: 2px 0 10px; }
.c-friend-card .c-fc-status.on { color: var(--c-green); font-weight: 600; }
.c-friend-card .c-fc-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* =====================================================================
   Create
   ===================================================================== */
.c-create { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; }
.c-create-nav { padding: 6px 0; }
.c-create-nav h4 { margin: 8px 14px 4px; font-size: 13px; color: var(--c-muted); text-transform: uppercase; font-weight: 600; }
.c-create-nav a, .c-create-nav span { display: block; padding: 6px 14px; color: var(--c-text); font-size: 15px; }
.c-create-nav a.active { color: var(--c-link); font-weight: 600; box-shadow: inset 3px 0 0 var(--c-link); }
.c-create-nav span { color: var(--c-faint); }
.c-asset-row {
  display: grid; grid-template-columns: 128px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--c-line);
}
.c-asset-row:last-child { border-bottom: 0; }
.c-asset-thumb { aspect-ratio: 16 / 9; background: #f2f2f2; border-radius: 2px; overflow: hidden; }
.c-asset-thumb.square { aspect-ratio: 1; width: 72px; }
.c-asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-asset-row h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; word-break: break-word; }
.c-asset-meta { font-size: 13px; color: var(--c-muted); }
.c-asset-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.c-form-card { padding: 16px; }
.c-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* =====================================================================
   Messages
   ===================================================================== */
.c-msg-tools { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--c-line); flex-wrap: wrap; }
.c-msg-row {
  display: grid; grid-template-columns: 22px 48px 160px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--c-line); cursor: pointer; color: var(--c-text);
}
.c-msg-row:hover { background: #f7fbff; }
.c-msg-row:last-child { border-bottom: 0; }
.c-msg-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-msg-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.c-msg-text b { font-weight: 600; }
.c-msg-text span { color: var(--c-muted); }
.c-msg-date { font-size: 13px; color: var(--c-muted); white-space: nowrap; }
.c-msg-view { padding: 18px; }
.c-msg-view h2 { margin: 0 0 8px; font-size: 24px; font-weight: 400; word-break: break-word; }
.c-msg-head { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--c-line); }
.c-msg-body { white-space: pre-wrap; word-break: break-word; padding: 16px 0; line-height: 1.5; }

/* =====================================================================
   Forum (classic table style)
   ===================================================================== */
.c-forum-crumbs { font-size: 14px; margin-bottom: 10px; }
.c-forum-crumbs a { font-weight: 600; }
.c-forum-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--c-shadow); font-size: 14px; }
.c-forum-table th { background: #2f6597; color: #fff; text-align: left; font-weight: 600; padding: 8px 10px; font-size: 13px; }
.c-forum-table td { padding: 9px 10px; border-top: 1px solid #dcdcdc; vertical-align: top; }
.c-forum-table tr.c-group td { background: #dce8f3; font-weight: 700; color: #1d466c; padding: 6px 10px; }
.c-forum-table tr:nth-child(even):not(.c-group) td { background: #fafafa; }
.c-forum-table .num { text-align: center; width: 80px; color: var(--c-muted); }
.c-forum-table .last { width: 210px; font-size: 13px; color: var(--c-muted); }
.c-forum-table th.num, .c-forum-table th.last { color: #fff; }
.c-forum-table .c-fname { font-size: 15px; font-weight: 600; }
.c-forum-table .c-fdesc { font-size: 13px; color: var(--c-muted); }
.c-pin { color: #f68802; margin-right: 4px; }
.c-forum-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.c-post { display: grid; grid-template-columns: 170px 1fr; background: #fff; box-shadow: var(--c-shadow); margin-bottom: 10px; }
.c-post-author { background: #f2f5f8; padding: 12px; text-align: center; font-size: 13px; border-right: 1px solid #dcdcdc; }
.c-post-author .c-avatar-circle { width: 84px; height: 84px; margin: 0 auto 6px; }
.c-post-author a { font-weight: 700; font-size: 14px; word-break: break-all; }
.c-post-author .c-role { display: inline-block; margin: 3px 0; }
.c-post-main { padding: 10px 14px; min-width: 0; }
.c-post-meta { font-size: 12px; color: var(--c-muted); border-bottom: 1px solid var(--c-line); padding-bottom: 6px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.c-post-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; word-break: break-word; }
.c-post-body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.c-votes { display: inline-flex; gap: 6px; }
.c-votes button { background: #fff; border: 1px solid var(--c-line); border-radius: 3px; cursor: pointer; padding: 1px 8px; color: var(--c-muted); font-family: inherit; }
.c-votes button.on { border-color: var(--c-link); color: var(--c-link); }

/* =====================================================================
   Small screens for the pages above
   ===================================================================== */
@media (max-width: 860px) {
  .c-av, .c-create { grid-template-columns: 1fr; }
  .c-av-preview .c-av-image { height: 220px; }
  .c-create-nav { display: flex; flex-wrap: wrap; }
  .c-create-nav h4 { width: 100%; }
  .c-msg-row { grid-template-columns: 22px 40px 1fr auto; }
  .c-msg-row .c-msg-who { grid-column: 3; grid-row: 1; }
  .c-msg-row .c-msg-date { grid-column: 4; grid-row: 1; }
  .c-msg-row .c-msg-text { grid-column: 2 / -1; grid-row: 2; }
  .c-forum-table .last, .c-forum-table .hide-sm { display: none; }
  .c-post { grid-template-columns: 1fr; }
  .c-post-author { display: flex; align-items: center; gap: 10px; text-align: left; border-right: 0; border-bottom: 1px solid #dcdcdc; }
  .c-post-author .c-avatar-circle { width: 44px; height: 44px; margin: 0; }
  .c-hello .c-avatar-circle { width: 80px; height: 80px; }
  .c-hello h1 { font-size: 26px; }
}
@media (max-width: 560px) {
  .c-asset-row { grid-template-columns: 80px 1fr; }
  .c-asset-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .c-form-grid { grid-template-columns: 1fr; }
}

/* visually hidden but available to screen readers */
.c-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
