/* COTOTF shared theme — used by every page */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600&display=swap');

:root {
  --bg:      #3b2723;
  --panel:   #2b1c19;
  --panel-2: #33221e;
  --line:    #4d342e;
  --text:    #d8c6b8;
  --dim:     #8f776c;
  --accent:  #e5b06b;
  --accent-2:#f7e77e;
  --blue:    #95a2eb;
  --pink:    #f3a8c8;
  --green:   #9fd49a;
  --red:     #ee8b7c;
  --sky:     #c4cce0;
  --font: 'Oswald', 'Arial Narrow', sans-serif;
  --col: 760px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100vh; overflow-x: hidden; font-family: var(--font); font-size: 14px; color: var(--text); }
html { background: var(--bg); }
body { display: flex; flex-direction: column; }
/* YOUR BACKGROUND: drop img/ui/bg.png in. It tiles by default and stays put while the page scrolls
   (a fixed layer, which also works on phones — background-attachment: fixed doesn't on iOS).
   For one big picture instead, change "repeat" to "no-repeat" and "auto" to "cover". */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url('/img/ui/bg.png') repeat center top;
  background-size: auto;
}
a { color: var(--accent); }
a:hover { color: var(--accent-2); }
img { display: block; }
button, input, select, textarea { font-family: var(--font); }
::selection { background: var(--accent); color: var(--panel); }

.wrap { width: 100%; max-width: var(--col); margin: 0 auto; padding: 0 14px; }
.page-main { flex: 1; padding: 18px 0 30px; }
.page-main.narrow .wrap { max-width: 440px; }
.page-title { font-weight: 500; font-size: 1.15rem; letter-spacing: .5px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.page-sub { font-size: .8rem; color: var(--dim); margin: -6px 0 14px; }

/* CURSOR — img/ui/cursor.png (32×32), and the orange cursor-pointer.png over links and buttons.
   The "1 1" is the click point: the arrow's tip is at pixel (1,1). Missing files fall back to the normal cursor. */
html, body { cursor: url('/img/ui/cursor.png') 1 1, auto; }
a, button, select, label, [onclick], [data-nav], .slot, .news-card, .ep-card, .team-btn, .char-btn, .logo-wrap {
  cursor: url('/img/ui/cursor-pointer.png') 1 1, url('/img/ui/cursor.png') 1 1, pointer;
}
input, textarea { cursor: text; }

/* HEADER */
.site-header { position: relative; background: var(--sky); border-bottom: 1px solid #000; overflow: hidden; }
/* drop img/ui/header.png in for the banner art */
.site-header .header-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.header-inner { position: relative; display: flex; flex-direction: column; align-items: center; padding: 18px 14px 10px; }
.header-inner .logo { width: 340px; max-width: 76vw; }
.header-inner .tagline { margin-top: 6px; font-size: .72rem; color: #5e3a33; }
.site-header.small .header-inner { padding: 10px 14px 8px; }
.site-header.small .logo { width: 200px; }

/* NAV */
#navbar { position: sticky; top: 0; z-index: 7000; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid #000; }
.nav-links { display: flex; justify-content: center; list-style: none; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block; padding: 11px 13px;
  font-weight: 500; font-size: .9rem; letter-spacing: .5px; text-transform: uppercase;
  color: var(--accent); text-decoration: none; white-space: nowrap;
}
.nav-links a:hover { color: var(--accent-2); }
.nav-links a.active { color: #fff; }
#nav-user { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .75rem; color: var(--dim); }

/* BAND — drop img/ui/band.png in to replace the plain stripes */
.band { height: 26px; background: linear-gradient(180deg, #f7e77e 0 26%, #fbef8c 26% 50%, #de8b58 50% 64%, #e5b06b 64% 100%); border-bottom: 1px solid #000; overflow: hidden; }
.band img { width: 100%; height: 100%; object-fit: cover; }

/* BOXES */
.box { background: var(--panel); border: 1px solid var(--line); }
.box + .box { margin-top: 14px; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 500; font-size: .9rem; letter-spacing: .5px; text-transform: uppercase; color: var(--accent); }
.box-head small { font-size: .72rem; text-transform: none; letter-spacing: 0; color: var(--dim); font-weight: 400; }
.box-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.box-body.center { align-items: center; text-align: center; padding: 30px 18px; }
.muted { color: var(--dim); }
.small { font-size: .8rem; }

/* FORMS */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); }
.field input, .field textarea, .field select, input.input, select.input {
  background: var(--panel-2); border: 1px solid var(--line); color: #fff;
  padding: 7px 9px; font-size: .9rem; outline: none; resize: vertical; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus, input.input:focus { border-color: var(--dim); }
.field input::placeholder, .field textarea::placeholder, input.input::placeholder { color: #6b564d; }
.field textarea { min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 7px; font-size: .85rem; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: .8rem; letter-spacing: .5px; text-transform: uppercase; color: var(--text); text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--dim); color: #fff; }
.btn:disabled { opacity: .45; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--panel); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--panel); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.sm { height: 26px; padding: 0 9px; font-size: .72rem; }
.btn.full { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: none; color: var(--dim); font-size: .78rem; text-decoration: underline; }
.link-btn:hover { color: var(--accent); }

/* MESSAGES */
.msg { font-size: .8rem; min-height: 1em; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }
.notice-line { padding: 8px 12px; font-size: .82rem; border: 1px solid var(--line); background: var(--panel-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice-line.warn { color: var(--accent-2); }
.notice-line.ok { color: var(--green); }

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { font-size: .82rem; padding: 8px 9px; border-bottom: 1px solid #3a2723; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.tag { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .5px; padding: 1px 6px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.tag.yellow { color: var(--accent-2); border-color: #6b5a2e; }
.tag.blue { color: var(--blue); border-color: #3f4677; }
.tag.pink { color: var(--pink); border-color: #74465a; }
.tag.green { color: var(--green); border-color: #3f5e3c; }
.tag.red { color: var(--red); border-color: #74403a; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; z-index: 8500; background: rgba(15,9,8,.8); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.active { display: flex; }
.modal { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); }
.modal-close { background: none; border: none; color: var(--dim); font-size: 1.1rem; line-height: 1; }
.modal-close:hover { color: #fff; }

/* ALERTS — set in Admin → Alerts */
.alert { position: relative; display: flex; align-items: center; justify-content: center; min-height: 74px; padding: 14px 90px; background: #1f1412; text-align: center; }
.alert + .alert { margin-top: 10px; }
.alert-text { font-weight: 500; font-size: 1.1rem; line-height: 1.5; color: var(--dim); }
.alert-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.alert-doodle { position: absolute; top: 50%; transform: translateY(-50%); width: 76px; height: 76px; object-fit: contain; }
.alert-doodle.left { left: 8px; }
.alert-doodle.right { right: 8px; }
.alert.highlight { background: #a4522c; }
.alert.highlight .alert-text { color: #fbe3a0; }
.alert.highlight .alert-text a { color: #fff; }
@media (max-width: 560px) {
  .alert { padding: 12px 58px; }
  .alert-text { font-size: .9rem; }
  .alert-doodle { width: 46px; height: 46px; }
}

/* FOOTER */
.site-footer { background: var(--panel); border-top: 1px solid #000; padding: 22px 14px 16px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 18px; align-items: center; max-width: var(--col); margin: 0 auto; }
.footer-links { list-style: none; text-align: right; }
.footer-links a { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.footer-links li + li { margin-top: 3px; }
.footer-divider { align-self: stretch; background: var(--line); }
.socials-row { display: flex; gap: 6px; }
.socials-row img { width: 54px; height: 54px; object-fit: contain; }
.socials-row a:hover img { filter: brightness(1.1); }
.footer-copy { text-align: center; font-size: .68rem; color: var(--dim); margin-top: 14px; }

@media (max-width: 700px) {
  #nav-user { display: none; }
  /* centered like on PC, but with auto margins instead of justify-content: center, so if the links ever
     overflow the bar scrolls from the first link instead of cutting it off on the left */
  .nav-links { justify-content: flex-start; }
  .nav-links li:first-child { margin-left: auto; }
  .nav-links li:last-child { margin-right: auto; }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-links { text-align: center; }
  .footer-divider { display: none; }
  .socials-row { justify-content: center; }
}

/* COMMUNITY — forums, profiles, leaderboard */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; letter-spacing: .3px; padding: 2px 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); white-space: nowrap; }
.badge img { width: 16px; height: 16px; object-fit: contain; }
.badge.yellow { color: var(--accent-2); border-color: #6b5a2e; }
.badge.pink { color: var(--pink); border-color: #74465a; }
.badge.blue { color: var(--blue); border-color: #3f4677; }
.badge.green { color: var(--green); border-color: #3f5e3c; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.av { width: 40px; height: 40px; flex: none; object-fit: cover; border: 1px solid var(--line); background: var(--panel-2); }
.av.sm { width: 26px; height: 26px; }
.user-link { color: #fff; font-weight: 500; text-decoration: none; }
.user-link:hover { color: var(--accent-2); }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 4px 0; }
.pager .btn.on { border-color: var(--accent); color: var(--accent); }
.crumbs { font-size: .78rem; color: var(--dim); margin-bottom: 8px; }
.crumbs a { color: var(--dim); }
.crumbs a:hover { color: var(--accent); }
.pic-attach { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pic-preview { display: flex; align-items: flex-end; gap: 8px; }
.pic-preview img { max-width: 160px; max-height: 120px; object-fit: contain; border: 1px solid var(--line); }
.post-pic { margin-top: 8px; }
.nav-bell { position: relative; display: flex !important; align-items: center; }
.nav-bell svg { display: block; }
.bell-count { position: absolute; top: 5px; right: 3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--red); color: #2b1c19; font-size: .62rem; font-weight: 600; line-height: 15px; text-align: center; }
.bell-count:empty { display: none; }
.bell-pop { position: fixed; z-index: 8000; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.bell-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); font-weight: 500; font-size: .82rem; letter-spacing: .5px; text-transform: uppercase; color: var(--accent); }
.bell-pop-head a { font-size: .72rem; color: var(--accent); }
.bell-pop-head a:hover { color: var(--accent-2); }
.bell-pop-list { max-height: min(420px, 70vh); overflow-y: auto; }
.bell-item { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px solid #3a2723; text-decoration: none; color: var(--text); font-size: .82rem; line-height: 1.4; }
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: var(--panel-2); }
.bell-item.unread { background: #33221e; }
.bell-item b { color: #fff; font-weight: 500; }
.bell-item .when { margin-left: auto; flex: none; font-size: .68rem; color: var(--dim); white-space: nowrap; }
.bell-pop-empty { padding: 14px 12px; font-size: .8rem; color: var(--dim); }
.mention { color: var(--blue); text-decoration: none; font-weight: 500; }
.mention:hover { color: var(--accent-2); }
.post-pic img { max-width: 100%; max-height: 420px; object-fit: contain; border: 1px solid var(--line); }

/* PROFILE — the account page (yours) and /profile/ (anyone's) */
.prof-card .prof-top { display: flex; gap: 16px; align-items: flex-start; padding: 16px; }
.prof-card .prof-av { width: 96px; height: 96px; flex: none; object-fit: cover; border: 1px solid var(--line); background: var(--panel-2); }
.prof-main { flex: 1; min-width: 0; }
.prof-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.35rem; font-weight: 500; color: #fff; }
.prof-bio { font-size: .9rem; line-height: 1.5; margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.prof-bio:empty { display: none; }
.prof-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: .74rem; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.chip b { color: var(--accent-2); font-weight: 600; }
a.chip:hover { border-color: var(--dim); color: #fff; }
.prof-fav { width: 120px; flex: none; text-align: center; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.prof-fav img { width: 72px; height: 72px; object-fit: contain; margin: 0 auto 4px; }
.prof-fav .k { font-size: .62rem; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); }
.prof-fav .n { font-size: .9rem; font-weight: 500; color: #fff; }
.prof-fav.empty { display: flex; flex-direction: column; justify-content: center; min-height: 100px; }
.prof-buttons { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
.prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.prof-grid .box { margin: 0 !important; }
.row-list > div { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #3a2723; font-size: .85rem; flex-wrap: wrap; }
.row-list > div:last-child { border-bottom: none; }
.pick { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; background: var(--panel-2); border: 1px solid var(--line); font-size: .78rem; }
.pick img { width: 22px; height: 22px; object-fit: cover; }
.settings-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #3a2723; }
.settings-row:last-child { border-bottom: none; }
.settings-row .k { width: 90px; flex: none; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); }
.settings-row .v { flex: 1; min-width: 0; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .prof-grid { grid-template-columns: 1fr; }
  .prof-card .prof-top { flex-wrap: wrap; }
  .prof-card .prof-av { width: 72px; height: 72px; }
  .prof-fav { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; }
  .prof-fav img { width: 44px; height: 44px; margin: 0; }
  .prof-fav.empty { min-height: 0; }
}
