/* UAFL Forums - a 2000s web-forum look, made accessible and responsive. */

:root {
  --font: Verdana, Tahoma, Geneva, "DejaVu Sans", sans-serif;
  --fs: 13px;
  --text: #000;
  --muted: #4a4a4a;
  --page: #ffffff;
  --cream: #fbf3d9;          /* main pane */
  --navy: #13246b;           /* thick rule, tabs */
  --title: #1d3a8a;
  --lav: #c9c9f2;            /* folder bars */
  --lav-line: #9f9fdc;
  --link: #0000cc;
  --visited: #551a8b;
  --maroon: #990033;
  --msghead: #cfcfcf;
  --rule: #b9b39b;
  --green: #127a21;
  --green-dark: #0b5a17;
  --tab: #dcdcdc;
  --tab-text: #4a4a4a;
  --panel: #fffdf4;
  --newflag: #c00000;
  --focus: #ff8c00;
  --quote: #eee8cc;
  --ad: #ffffff;
}
:root[data-theme="night"] {
  --text: #ece9df;
  --muted: #b9b6ad;
  --page: #11141c;
  --cream: #1b1f2b;
  --navy: #6f86d6;
  --title: #a9bbff;
  --lav: #2f3566;
  --lav-line: #4a518f;
  --link: #9db8ff;
  --visited: #c9a6ff;
  --maroon: #ff8fb0;
  --msghead: #2c3142;
  --rule: #3b4157;
  --green: #1f8f2f;
  --green-dark: #146b21;
  --tab: #2a2f3d;
  --tab-text: #c9c6bd;
  --panel: #232838;
  --newflag: #ff6b6b;
  --focus: #ffb347;
  --quote: #262b3b;
  --ad: #252a39;
  color-scheme: dark;
}
:root[data-size="large"] { --fs: 15px; }

* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; font: var(--fs)/1.4 var(--font); color: var(--text); background: var(--page); }
a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
#main:focus, h2[tabindex="-1"]:focus { outline: none; }
h2[tabindex="-1"]:focus-visible { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 4px; background: #ffd; color: #000; padding: 6px 10px; z-index: 10; border: 2px solid #000; }
.skip:focus { left: 8px; }
.small { font-size: .85em; color: var(--muted); }
.ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; flex: none; }
kbd { font: .9em/1 "Courier New", monospace; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 3px; padding: 1px 4px; background: var(--panel); }

/* link-looking buttons (logout, mark as read...) */
.linklike { font: inherit; color: var(--link); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* buttons */
.btn-green, .btn-grey, .btn-red {
  display: inline-block; font: bold .9em var(--font); padding: 2px 9px; border: 1px solid var(--green-dark);
  background: linear-gradient(#1c9a2e, var(--green)); color: #fff; text-decoration: none; cursor: pointer; border-radius: 2px;
}
.btn-green:visited { color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-grey { background: linear-gradient(#f4f4f4, #d6d6d6); color: #000; border-color: #8a8a8a; font-weight: normal; }
.btn-red { background: #b3001b; border-color: #6b0010; }

/* ---------------- top bar ---------------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 4px 12px 3px; border-bottom: 1px solid #b8b8b8; background: var(--page); flex-wrap: wrap; }
.logo { display: block; line-height: 0; padding-right: 14px; border-right: 1px solid #c8c8c8; }
:root[data-theme="night"] .logo svg { background: #f4f4f4; border-radius: 4px; }
.who { flex: 1 1 260px; color: var(--title); }
.who .handle { font-size: 1.55em; color: var(--title); }
.who .who-links, .who .memtype { font-size: .92em; }
.who .memtype { font-style: italic; color: var(--muted); }
.who .linklike { color: var(--title); }
.toplinks { display: flex; align-items: center; gap: 14px; border-left: 1px solid #c8c8c8; padding-left: 14px; }
.toplinks ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto auto; column-gap: 28px; row-gap: 2px; font-size: .92em; }
.toplinks li span:not(.tm) { color: var(--muted); display: inline-block; min-width: 1.2em; }
.toplinks a { color: var(--title); }
.theme-toggle { font: .85em var(--font); background: var(--panel); color: var(--text); border: 1px solid var(--rule); border-radius: 12px; padding: 3px 10px; cursor: pointer; white-space: nowrap; }
.theme-toggle[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
:root[data-theme="night"] .theme-toggle[aria-pressed="true"] { color: #0d1020; }

/* ---------------- forum header ---------------- */
.forumhead { padding: 6px 12px 0; border-bottom: 3px solid var(--navy); background: var(--page); }
.forum-title { margin: 0; font-size: 1.62em; line-height: 1.15; }
.forum-title a { color: var(--title); text-decoration: none; }
.tabs { display: flex; align-items: flex-end; gap: 3px; margin-top: 4px; }
.tabs > a { padding: 2px 9px; background: var(--tab); color: var(--tab-text); text-decoration: none; border-radius: 4px 4px 0 0; font-size: .95em; }
.tabs > a.active { background: var(--navy); color: #fff; }
:root[data-theme="night"] .tabs > a.active { color: #0d1020; }
.tabs .host { margin-left: 10px; padding-bottom: 2px; color: var(--muted); font-size: .95em; }
.tabs .host a { color: var(--title); text-decoration: none; }

/* ---------------- layout ---------------- */
.layout { display: grid; grid-template-columns: 276px minmax(0, 1fr); align-items: stretch; min-height: 70vh; }
.side-toggle { display: none; }
.sidebar { background: var(--page); padding: 6px 0 16px 2px; border-right: 1px solid var(--rule); grid-row: 1; }
.main { background: var(--cream); padding: 0 14px 24px 2px; min-width: 0; border-left: 14px solid var(--cream); box-shadow: inset 1px 0 0 var(--rule); }

/* ---------------- sidebar ---------------- */
.side-links { list-style: none; margin: 0; padding: 0 2px; }
.side-links li { margin: 1px 0; }
.side-links a { display: inline-flex; align-items: center; }
.show-form { margin: 6px 0 10px; }
.show-form label, .side-search label { display: block; font-weight: bold; }
.row { display: flex; gap: 5px; align-items: center; }
.show-form select { font: inherit; flex: 1; min-width: 0; }
.side-search input { font: inherit; flex: 1; min-width: 0; border: 1px solid #7a7a7a; padding: 2px 3px; }

.folder { margin: 0 0 12px; }
.folder-bar { display: flex; align-items: center; margin: 0; padding: 2px 4px; font-size: 1em; background: var(--lav); border-top: 1px solid var(--lav-line); }
.folder-bar a { color: #11115a; font-weight: bold; }
:root[data-theme="night"] .folder-bar a { color: #e6e8ff; }
.folder-meta { display: flex; justify-content: space-between; padding: 1px 6px 2px 18px; font-size: .92em; }
.maroon, a.maroon, a.maroon:visited { color: var(--maroon); }
.crumb .maroon { font-weight: bold; }
.threads { list-style: none; margin: 2px 0 0; padding: 0; }
.threads li { display: grid; grid-template-columns: 16px minmax(0, 1fr) 52px; column-gap: 0; padding: 1px 4px 3px 0; align-items: start; }
.threads li.current { background: rgba(201, 201, 242, .45); }
:root[data-theme="night"] .threads li.current { background: var(--lav); }
.threads .t-icon .ic { margin: 0; }
.threads .t-main { padding-left: 2px; overflow-wrap: anywhere; }
.threads li.current .t-main a { font-weight: bold; }
.t-count { color: var(--text); white-space: nowrap; }
.t-date { text-align: right; font-size: .92em; color: var(--text); white-space: nowrap; padding-left: 4px; }
.side-foot { padding: 4px 2px; }
.side-foot p { margin: 2px 0; }
.side-search { margin-top: 8px; }

/* ---------------- ad slot ---------------- */
.adwrap { margin: 0 auto 6px; padding-top: 10px; max-width: 820px; text-align: center; }
.ad { position: relative; display: grid; grid-template-columns: 168px minmax(0, 1fr) 104px; align-items: stretch; background: var(--ad); border: 1px solid #e3dcc2; text-align: left; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ad-mark { position: absolute; left: 3px; top: 1px; color: #3b7dd8; font-size: 11px; }
.ad-art svg { display: block; width: 168px; height: 100px; }
.ad-text { padding: 8px 14px; border-right: 1px solid #ece6cf; }
.ad-head { margin: 0 0 6px; font: 1.28em/1.3 "Segoe UI", Helvetica, Arial, sans-serif; color: var(--text); }
.ad-src { margin: 0; font: .82em Helvetica, Arial, sans-serif; color: var(--muted); }
.ad-open { display: flex; align-items: center; justify-content: center; font: bold 1.08em Helvetica, Arial, sans-serif; color: #1a63d6; text-decoration: none; }
:root[data-theme="night"] .ad-open { color: #8fb4ff; }
.ad-open:hover { background: rgba(26, 99, 214, .07); text-decoration: underline; }
.adfree { margin: 6px 0 0; }

/* ---------------- message ---------------- */
.crumb { font-size: 1em; margin: 6px 0 6px -10px; font-weight: bold; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; }
.crumb .ic { align-self: center; }
.crumb .views { font-weight: normal; }
.main > h2#page-h:not(.crumb) { font-size: 1.15em; margin: 12px 0 8px; color: var(--title); }
.msg { background: transparent; margin: 0 0 10px; }
.msg-head { display: flex; justify-content: space-between; gap: 10px; background: var(--msghead); padding: 3px 10px 4px; }
.mh-left .to { padding-left: 18px; }
.mh-right { text-align: right; font-size: .88em; color: var(--muted); white-space: nowrap; }
.mh-right a { color: var(--muted); }
.author { font-weight: bold; color: var(--link); }
.badge { vertical-align: middle; }
.msg-head .badge { vertical-align: -3px; }
.host-icons .ic { margin: 0 0 0 2px; }
.newflag { display: inline-block; font: bold 9px/1 var(--font); color: #fff; background: var(--newflag); padding: 2px 3px; border-radius: 2px; letter-spacing: .5px; vertical-align: 1px; }
:root[data-theme="night"] .newflag { color: #1b0000; }
.tome { color: var(--maroon); font-size: .9em; }
.msg-body { padding: 18px 10px 4px; max-width: 72em; overflow-wrap: anywhere; }
.msg-body p { margin: 0 0 12px; }
.msg-body p:first-child strong:only-child { font-size: 1.04em; }
.quote { margin: 6px 0 12px; padding: 6px 10px; background: var(--quote); border-left: 4px solid var(--lav-line); }
.quote p { margin: 0 0 6px; }
.quote-cite { font-weight: bold; font-size: .9em; color: var(--muted); }
.sig { padding: 10px 10px 4px; }
.sig-rule { display: block; width: 180px; border-top: 1px dashed var(--rule); margin: 4px 0 10px; }
.sig-inner { display: flex; gap: 12px; align-items: center; }
.sig-badge { line-height: 0; }
.sig-text { font-size: .92em; }
.sig-text em { color: var(--muted); }

.msg-tools { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 6px 4px; margin: 8px 0 14px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; }
.msg-tools ul { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; }
.btn-tool { display: inline-block; padding: 2px 9px; background: linear-gradient(#ffffff, #e4e0cf); border: 1px solid #9c9682; color: #00008b; text-decoration: none; font-size: .92em; border-radius: 2px; }
.btn-tool:visited { color: #00008b; }
.btn-tool:hover { background: #fff; text-decoration: underline; }
.btn-tool.off { color: #6b6b6b; background: transparent; border-style: dashed; }
:root[data-theme="night"] .btn-tool { background: linear-gradient(#2e3446, #252a39); color: #d6e0ff; border-color: #4a5170; }
.msg-pos { margin: 0; font-size: .85em; color: var(--muted); }

.thread-outline h3 { font-size: 1em; margin: 0 0 4px; display: flex; align-items: center; gap: 4px; }
.outline-tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dotted var(--rule); }
.outline-tree > ul { padding-left: 4px; border-left: 0; }
.outline-tree li { margin: 1px 0; }
.ol-row { display: inline-block; padding: 1px 4px; }
.ol-row.current { background: var(--lav); }
.ol-row.current a { color: #11115a; font-weight: bold; }
:root[data-theme="night"] .ol-row.current a { color: #fff; }
.ol-date { font-size: .82em; color: var(--muted); white-space: nowrap; }
.ol-folder { margin-bottom: 10px; }
.ol-thread { margin: 4px 0 4px 8px; }
.ol-thread summary { cursor: pointer; color: var(--link); text-decoration: underline; }

.msg-compact { border: 1px solid var(--rule); background: var(--panel); }
.msg-compact .msg-body { padding-top: 10px; }
.msg-mini-tools { margin: 0; padding: 0 10px 6px; font-size: .9em; }
.depth-1 { margin-left: 24px; } .depth-2 { margin-left: 48px; } .depth-3 { margin-left: 72px; } .depth-4, .depth-5 { margin-left: 96px; }
.viewswitch { margin: 0 0 10px; }

/* ---------------- forms ---------------- */
.composer, .search-form, .prefs { background: var(--panel); border: 1px solid var(--rule); padding: 10px 12px; max-width: 760px; }
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.frow.col { flex-direction: column; align-items: stretch; }
.flabel { font-weight: bold; min-width: 66px; }
.composer input[type=text], .composer select, .search-form input, .search-form select { font: inherit; padding: 2px 4px; border: 1px solid #7a7a7a; background: #fff; color: #000; }
.composer input[type=text] { flex: 1; min-width: 12em; }
.composer input[readonly] { background: #eee; }
.composer textarea { font: 1em/1.4 var(--font); padding: 6px; border: 1px solid #7a7a7a; width: 100%; background: #fff; color: #000; }
:root[data-theme="night"] .composer input, :root[data-theme="night"] .composer select, :root[data-theme="night"] .composer textarea,
:root[data-theme="night"] .search-form input, :root[data-theme="night"] .search-form select { background: #0f1320; color: var(--text); border-color: #59607a; }
.frow.actions { gap: 10px; }
.err { background: #fde8e8; border: 2px solid #b3001b; color: #6b0010; padding: 6px 10px; margin-bottom: 8px; }
.preview h3 { font-size: 1em; margin: 12px 0 4px; }
.preview .msg { border: 1px dashed var(--rule); }
.replying-to { margin: 0 0 10px; background: var(--panel); border: 1px solid var(--rule); padding: 4px 10px; max-width: 760px; }
.replying-to summary { cursor: pointer; font-weight: bold; }
.notice { background: var(--panel); border: 1px solid var(--rule); padding: 8px 12px; max-width: 640px; }
.prefs fieldset { border: 1px solid var(--rule); margin: 0 0 10px; }
.prefs legend { font-weight: bold; }
.opt { display: block; margin: 3px 0; }

/* ---------------- tables, panels, start page ---------------- */
.tablewrap { overflow-x: auto; }
.grid { border-collapse: collapse; width: 100%; background: var(--panel); }
.grid th, .grid td { border: 1px solid var(--rule); padding: 3px 6px; text-align: left; vertical-align: middle; }
.grid thead th { background: var(--lav); color: #11115a; }
:root[data-theme="night"] .grid thead th { color: #e6e8ff; }
.grid tbody th { font-weight: normal; white-space: nowrap; }
.panel { background: var(--panel); border: 1px solid var(--rule); padding: 6px 10px 8px; margin: 0 0 12px; }
.panel h3 { margin: 0 0 6px; font-size: 1em; background: var(--lav); margin: -6px -10px 8px; padding: 3px 10px; color: #11115a; }
:root[data-theme="night"] .panel h3 { color: #e6e8ff; }
.welcome { display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--rule); padding: 10px 12px; margin-bottom: 12px; max-width: 900px; }
.welcome p { margin: 0 0 8px; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 12px; }
.standings td, .standings th { white-space: nowrap; }
.fixtures, .latest, .results { margin: 0; padding-left: 0; list-style: none; }
.fixtures li { padding: 2px 0; }
.fixtures .at { color: var(--muted); font-style: italic; padding: 0 4px; }
.latest li { padding: 3px 0; border-bottom: 1px dotted var(--rule); }
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.badges a { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; padding: 4px; border-radius: 4px; }
.badges a:hover { background: var(--lav); }
.badges a span:first-of-type { text-decoration: underline; }
.stats { margin-top: 6px; }
.member { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; }
.facts dt { font-weight: bold; }
.facts dd { margin: 0; }
.upsell { max-width: 640px; border-style: dashed; }
.results li { padding: 6px 0; border-bottom: 1px dotted var(--rule); }
.snip { margin: 2px 0 0; color: var(--text); }
mark { background: #ffe86b; color: #000; padding: 0 1px; }
.empty { font-style: italic; color: var(--muted); }
.result-count { margin: 10px 0 6px; }

/* ---------------- dialogs ---------------- */
dialog { border: 2px solid var(--navy); padding: 0; max-width: min(560px, 94vw); background: var(--page); color: var(--text); font: var(--fs)/1.4 var(--font); }
dialog::backdrop { background: rgba(10, 16, 48, .45); }
dialog form { padding: 0 16px 14px; }
dialog h2 { margin: 0 -16px 10px; padding: 6px 16px; font-size: 1.05em; background: var(--lav); color: #11115a; }
:root[data-theme="night"] dialog h2 { color: #e6e8ff; }
.acct-pick { border: 0; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; max-height: 56vh; overflow: auto; }
.acct { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--rule); cursor: pointer; background: var(--panel); }
.acct span { display: flex; flex-direction: column; }
.acct:has(input:checked) { background: var(--lav); border-color: var(--navy); }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.keys dd { margin: 0; }

/* ---------------- footer & toast ---------------- */
.footer { border-top: 3px solid var(--navy); padding: 8px 12px 16px; font-size: .88em; color: var(--muted); background: var(--page); }
.footer p { margin: 3px 0; }
.footer strong { color: var(--text); }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 40px); opacity: 0; background: #13246b; color: #fff; padding: 8px 14px; border-radius: 3px; transition: .25s; pointer-events: none; z-index: 20; max-width: 92vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------------- phone ---------------- */
@media (max-width: 800px) {
  :root { --fs: 14px; }
  :root[data-size="large"] { --fs: 16px; }
  .topbar { gap: 6px 10px; padding: 6px 10px; }
  .logo { border-right: 0; padding-right: 0; }
  .logo svg { width: 110px; height: 38px; }
  .who { flex: 1 1 150px; }
  .who .handle { font-size: 1.3em; }
  .toplinks { border-left: 0; padding-left: 0; width: 100%; justify-content: space-between; border-top: 1px solid #ddd; padding-top: 4px; }
  .toplinks ul { column-gap: 12px; font-size: .86em; }
  .toplinks li { white-space: nowrap; }
  .toplinks { flex-wrap: wrap; row-gap: 6px; }
  .toplinks .tm { display: none; }
  .forumhead { padding: 4px 10px 0; }
  .tabs .host { margin-left: auto; }
  .layout { display: block; }
  .side-toggle { display: flex; align-items: center; gap: 6px; width: 100%; font: bold 1em var(--font); text-align: left; background: var(--lav); color: #11115a; border: 0; border-bottom: 1px solid var(--lav-line); padding: 10px 12px; cursor: pointer; }
  :root[data-theme="night"] .side-toggle { color: #e6e8ff; }
  .side-toggle[aria-expanded="true"] { background: var(--navy); color: #fff; }
  .side-unread { font-weight: normal; color: var(--maroon); margin-left: auto; }
  .side-toggle[aria-expanded="true"] .side-unread { color: #fff; }
  .sidebar { display: none; border-right: 0; border-bottom: 3px solid var(--navy); padding: 8px 8px 12px; }
  .sidebar.open { display: block; }
  .threads li { grid-template-columns: 18px minmax(0, 1fr) 56px; padding: 4px 4px 4px 0; }
  .side-links a, .threads a, .folder-meta a { padding: 2px 0; }
  .main { border-left: 0; box-shadow: none; padding: 0 10px 20px; }
  .crumb { margin-left: 0; }
  .ad { grid-template-columns: 96px minmax(0, 1fr); }
  .ad-art svg { width: 96px; height: 100%; min-height: 70px; object-fit: cover; }
  .ad-text { border-right: 0; padding: 6px 10px; }
  .ad-head { font-size: 1.02em; }
  .ad-open { grid-column: 1 / -1; border-top: 1px solid #ece6cf; padding: 6px; }
  .msg-head { flex-direction: column; gap: 2px; padding: 4px 8px; }
  .mh-right { text-align: left; white-space: normal; }
  .msg-body { padding: 12px 4px 2px; }
  .btn-tool { padding: 6px 10px; }
  .depth-1 { margin-left: 10px; } .depth-2 { margin-left: 20px; } .depth-3, .depth-4, .depth-5 { margin-left: 30px; }
  .start-grid { grid-template-columns: 1fr; }
  .welcome { flex-direction: column; }
  .member { flex-direction: column; }
  .flabel { min-width: 0; width: 100%; }
  .composer input[type=text] { min-width: 0; width: 100%; }
}
