:root{
  --bg: #1b1f2a;
  --paper: #f6f1dd;
  --paper2: #efe6c8;
  --ink: #1a1a1a;
  --panel: #fdf7e4;
  --border: #3b3f4b;
  --border2:#a08f61;
  --accent:#3b83f6;
  --accent2:#f6b73c;
  --good:#2bb673;
  --bad:#e04f5f;
  --shadow: rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  color:var(--ink);
  font-family: Tahoma, Verdana, Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.08), transparent 35%),
    radial-gradient(circle at 90% 30%, rgba(255,255,255,.06), transparent 40%),
    linear-gradient(180deg, #141825, #0f1220 60%, #0c0e19);
}

/* centered classic fixed width */
.page{
  width: 960px;
  margin: 16px auto;
  border: 3px solid var(--border);
  box-shadow: 0 10px 30px var(--shadow);
  background: var(--paper);
}

/* header */
.topbar{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  background: linear-gradient(#fef8e7, #e9dfc0);
  border-bottom: 3px solid var(--border);
}

.brand{ display:flex; align-items:center; gap:10px; min-width: 250px; }
.brand__logo{
  width:42px; height:42px;
  display:grid; place-items:center;
  font-weight:900;
  border: 2px solid var(--border);
  background: linear-gradient(#ffffff, #d9d0b4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.brand__title{ font-weight:900; letter-spacing:.3px; }
.brand__tag{ font-size:12px; opacity:.75; }

.nav{ display:flex; gap:10px; flex:1; }
.nav a{
  color:#102;
  text-decoration:none;
  font-weight:700;
  font-size:13px;
  padding:6px 8px;
  border: 2px solid #5b4f33;
  background: linear-gradient(#fff, #eadfbf);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.nav a:hover{ filter:brightness(.97); }

.userbox{
  display:flex; align-items:center; gap:10px;
  padding:6px 8px;
  border: 2px solid #5b4f33;
  background: linear-gradient(#fff, #eadfbf);
}
.userbox__name{ font-weight:900; }

.ticker{
  display:flex;
  gap:10px;
  padding:8px 12px;
  background: linear-gradient(#2a2f3b, #1d2230);
  color:#fff;
  border-bottom: 3px solid var(--border);
  font-size:13px;
}
.ticker__label{ color: var(--accent2); font-weight:900; }

.layout{
  display:grid;
  grid-template-columns: 1fr 290px;
  gap:12px;
  padding:12px;
  background: linear-gradient(#f7f0d8, #efe6c8);
}

.content{ min-height: 520px; }
.sidebar{ display:flex; flex-direction:column; gap:12px; }

.panel{
  border: 2px solid #5b4f33;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.panel__title{
  padding:6px 8px;
  font-weight:900;
  font-size:13px;
  color:#111;
  background: linear-gradient(#fff, #eadfbf);
  border-bottom: 2px solid #5b4f33;
}
.panel__body{ padding:10px 10px; font-size:13px; }

.footer{
  padding:10px 12px;
  background: linear-gradient(#fef8e7, #e9dfc0);
  border-top: 3px solid var(--border);
}

/* common bits */
.small{ font-size:12px; }
.dim{ opacity:.75; }
.btn{
  border: 2px solid #5b4f33;
  background: linear-gradient(#ffffff, #eadfbf);
  padding:6px 10px;
  font-weight:900;
  cursor:pointer;
}
.btn--primary{
  border-color:#1a3f8a;
  background: linear-gradient(#d7e7ff, #9cc2ff);
}
.btn:hover{ filter:brightness(.98); }

.box{
  border: 2px solid #5b4f33;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  margin-bottom:12px;
}
.box__title{
  padding:8px 10px;
  background: linear-gradient(#fff, #eadfbf);
  border-bottom: 2px solid #5b4f33;
  font-weight:900;
}
.box__body{ padding:10px; }

.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.card{
  border: 2px solid #5b4f33;
  background: #fffdf0;
  margin:10px 0;
}
.card__head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  background: linear-gradient(#ffffff, #f0e7c9);
  border-bottom: 2px solid #5b4f33;
}
.card__title{
  font-weight:900;
  text-decoration:none;
  color:#111;
}
.card__meta{ font-size:12px; opacity:.75; }
.card__body{ padding:10px; display:flex; gap:10px; }
.thumb{
  width:140px; height:90px;
  border:2px solid #5b4f33;
  background: #eee;
  flex: 0 0 auto;
}
.card__text{ font-size:13px; }

.vote{
  display:flex;
  gap:6px;
  align-items:center;
}
.pill{
  display:inline-block;
  padding:2px 8px;
  border: 2px solid #5b4f33;
  background: linear-gradient(#fff, #eadfbf);
  font-weight:900;
  font-size:12px;
}

.btnVote{
  width:32px; height:28px;
  display:grid; place-items:center;
  border: 2px solid #5b4f33;
  background: linear-gradient(#fff, #eadfbf);
  cursor:pointer;
  user-select:none;
  font-weight:900;
}
.btnVote.up.active{ border-color: #0a6b3b; background: linear-gradient(#d8ffe9, #a6f4cc); }
.btnVote.down.active{ border-color: #8a1a28; background: linear-gradient(#ffd8dc, #ffb1ba); }

.input{
  width:100%;
  padding:8px 10px;
  border: 2px solid #5b4f33;
  background: #fff;
  font-family: inherit;
}

.label{ font-weight:900; font-size:12px; }

.hr{ height:2px; background:#5b4f33; margin:10px 0; }

.tag{
  display:inline-block;
  margin: 4px 6px 0 0;
  padding:2px 6px;
  border: 2px solid #5b4f33;
  background: linear-gradient(#fff, #eadfbf);
  font-size:12px;
  cursor:pointer;
}

.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.55);
}
.modal.show{ display:flex; }
.modal__card{
  width: 420px;
  border: 3px solid var(--border);
  background: var(--paper);
  box-shadow: 0 10px 30px var(--shadow);
  padding:12px;
}
.modal__title{ font-weight:900; margin-bottom:10px; }
.modal__row{ margin:10px 0; }
.modal__actions{ display:flex; justify-content:flex-end; gap:10px; }

.noscript{
  padding: 12px;
  background: #fff;
  border-top: 3px solid var(--border);
}
