/* ==========================================================================
   kraken.moe — site stylesheet
   --------------------------------------------------------------------------
   The visual language is lifted directly from Puzzle Pirates' "yoweb" pages:
     page background   #C5C7AE   (sage/khaki)
     panel fill        #CDCEB5
     panel edge        #B3AD86
     muted label ink   #958A5F
     link              #306292   (visited #6A818B)
     body ink          #000000
     body font         Arial, Helvetica, sans-serif
   yoweb builds its boxes out of nested tables + 1px "shim" images; here the
   same look is produced with ordinary CSS so the markup stays readable.
   The rope strips (header.png / footer.png) and the ornate panel caps
   (tableheader.png, crewtableheader.png) are yoweb's own artwork, copied into
   assets/yoweb/.
   ========================================================================== */

:root {
  --bg:        #C5C7AE;   /* page background              */
  --bg-alt:    #C3C4AA;   /* slightly darker bg (fame pages) */
  --panel:     #CDCEB5;   /* panel fill                  */
  --panel-2:   #D6D7C1;   /* raised element              */
  --edge:      #B3AD86;   /* 1px border                  */
  --edge-soft: #C0C0A4;   /* row separator               */
  --label:     #958A5F;   /* small caps / field labels   */
  --link:      #306292;
  --link-vis:  #6A818B;
  --ink:       #000000;
  --ok:        #3E6B3E;
  --warn:      #8A5A1F;
  --dead:      #7A3A3A;

  --col:       890px;     /* centre column width */
  --gap:       16px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.45 Arial, Helvetica, sans-serif;
}

a         { color: var(--link); }
a:visited { color: var(--link-vis); }
a:hover   { color: #1B3F63; }

img { border: 0; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 10px 10px 40px;
}

.cols      { display: grid; grid-template-columns: 208px 1fr; gap: var(--gap); align-items: start; }
.cols-wide { display: grid; grid-template-columns: 1fr 208px; gap: var(--gap); align-items: start; }
.cols-3    { display: grid; grid-template-columns: 208px 1fr 208px; gap: var(--gap); align-items: start; }
.grid-3    { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-2    { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.stack     { display: grid; gap: var(--gap); }
@media (max-width: 720px) {
  .cols, .cols-wide, .cols-3, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Masthead — rope rules + centred logo + nav
   -------------------------------------------------------------------------- */
.masthead { text-align: center; }

.rope {
  height: 18px;
  background: url("yoweb/header.png") repeat-x center center;
  background-size: auto 18px;
}
.rope-foot {
  height: 18px;
  background: url("yoweb/footer.png") repeat-x center center;
  background-size: auto 18px;
}

.brand { display: inline-block; margin: 6px 0 2px; }
.brand img { display: block; width: 100%; max-width: 440px; height: auto; }

.mainnav {
  padding: 6px 0 4px;
  font-size: 13px;
  letter-spacing: .01em;
}
.mainnav a { margin: 0 7px; }
.mainnav a.here { font-weight: bold; text-decoration: none; color: var(--ink); }
.mainnav .sep { color: var(--label); }

/* --------------------------------------------------------------------------
   Page heading
   -------------------------------------------------------------------------- */
.page-title {
  margin: 14px 0 4px;
  font-size: 21px;
  font-weight: bold;
  text-align: center;
}
.page-sub {
  margin: 0 0 14px;
  text-align: center;
  font-size: 11px;
  color: var(--label);
}

/* --------------------------------------------------------------------------
   Panels — the yoweb box: 1px dark edge, lighter fill
   -------------------------------------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  padding: 8px 10px;
}
.panel + .panel { margin-top: 10px; }
.panel-flush { padding: 0; }
.panel-head {
  margin: -8px -10px 8px;
  padding: 4px 10px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--edge);
  font-weight: bold;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #4A452C;
}
.panel-note {
  background: #D9D2AE;
  border-color: #C4B98A;
}
.panel h2, .panel h3 { margin: 0 0 8px; }

/* ornate cap artwork sitting on top of a panel (yoweb table headers) */
.capped { text-align: center; }
.capped > img.cap { display: block; margin: 0 auto -2px; position: relative; z-index: 1; }
.capped > .panel { text-align: left; }

/* small label row (yoweb's #958A5F italic labels) */
.label {
  color: var(--label);
  font-size: 11px;
  font-style: italic;
}
.muted  { color: #5B5640; }
.tiny   { font-size: 11px; }
.center { text-align: center; }
.right  { text-align: right; }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.tbl caption {
  caption-side: top;
  text-align: left;
  font-size: 11px;
  color: var(--label);
  font-style: italic;
  padding-bottom: 4px;
}
table.tbl th {
  text-align: left;
  font-weight: bold;
  text-decoration: underline;      /* yoweb underlines its column heads */
  padding: 4px 6px;
  border-bottom: 1px solid var(--edge);
  white-space: nowrap;
  background: var(--bg-alt);
}
table.tbl td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--edge-soft);
  vertical-align: top;
}
table.tbl tbody tr:nth-child(even) td { background: rgba(197, 199, 174, .55); }
table.tbl tbody tr:hover td { background: #DDDECA; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.ctr, table.tbl th.ctr { text-align: center; }
table.tbl .rowhead { font-weight: bold; }
table.tbl tr.total td { border-top: 2px solid var(--edge); font-weight: bold; }

/* stacked field-list table (label / value) */
table.fields { width: 100%; border-collapse: collapse; font-size: 13px; }
table.fields th {
  text-align: left;
  font-weight: normal;
  color: var(--label);
  font-size: 11px;
  font-style: italic;
  padding: 3px 6px 3px 0;
  white-space: nowrap;
  vertical-align: top;
  width: 40%;
}
table.fields td { padding: 3px 0; vertical-align: top; }

/* --------------------------------------------------------------------------
   Badges / pills
   -------------------------------------------------------------------------- */
.tag {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--edge);
  background: var(--panel-2);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #4A452C;
  white-space: nowrap;
}
.tag-auction { background: #C9D6E2; border-color: #8FA6BC; color: #24425E; }
.tag-buy     { background: #CFDCC4; border-color: #97AE86; color: #2F4A28; }
.tag-done    { background: #DCD6BC; border-color: #BFB489; color: #4A452C; }
.tag-new     { background: #E4D3B8; border-color: #C3A87A; color: #6A4A18; }
.tag-closed  { background: #D8C9C9; border-color: #B99A9A; color: #6A3A3A; }

/* entity chips (rank / reputation) */
.chip { white-space: nowrap; }
.chip img { vertical-align: -6px; margin-right: 3px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font: bold 12px Arial, Helvetica, sans-serif;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(#DEDEC9, #C6C7AD);
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 4px 11px;
  cursor: pointer;
}
.btn:hover  { background: linear-gradient(#E9E9D6, #D2D3BB); color: var(--ink); }
.btn:active { background: linear-gradient(#C6C7AD, #DEDEC9); }
.btn-primary {
  background: linear-gradient(#4C7CA8, #306292);
  border-color: #24506F;
  color: #FFFFFF;
}
.btn-primary:hover { background: linear-gradient(#5A8CB8, #3A6E9E); color: #FFFFFF; }
.btn-danger { background: linear-gradient(#A85C5C, #8C4444); border-color: #6E3131; color: #FFF; }
.btn-danger:hover { background: linear-gradient(#B76A6A, #9A4E4E); color: #FFF; }
.btn-sm  { font-size: 11px; padding: 2px 7px; }
.btn-lg  { font-size: 14px; padding: 7px 18px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
input[type="text"], input[type="password"], input[type="number"],
input[type="search"], input[type="email"], select, textarea {
  font: 13px Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--edge);
  padding: 3px 5px;
  border-radius: 1px;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 1px solid #7D94A8; }
input[type="radio"], input[type="checkbox"] { vertical-align: -1px; }
textarea { width: 100%; min-height: 76px; resize: vertical; }

.form-row { margin-bottom: 9px; }
.form-row > label.field-label {
  display: block;
  font-size: 11px;
  font-style: italic;
  color: var(--label);
  margin-bottom: 2px;
}
.form-hint { font-size: 11px; color: #6B6549; margin-top: 3px; }
.fieldset {
  border: 1px solid var(--edge);
  background: rgba(214, 215, 193, .5);
  padding: 8px 10px 10px;
  margin: 0 0 12px;
}
.fieldset > legend {
  font-weight: bold;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #4A452C;
  padding: 0 5px;
}

/* filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filters .form-row { margin: 0; }

/* --------------------------------------------------------------------------
   Portrait frame (yoweb portraittop / left / right / bottom)
   -------------------------------------------------------------------------- */
.portrait { width: 196px; margin: 0 auto; }
.portrait .p-top, .portrait .p-bottom { display: block; margin: 0 auto; }
.portrait .p-mid { display: flex; justify-content: center; align-items: stretch; }
.portrait .p-mid > img { display: block; }
.portrait .p-img {
  width: 174px;
  min-height: 255px;
  background: #B9BBA1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6B6549;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   Misc yoweb flourishes
   -------------------------------------------------------------------------- */
.rule-shim { height: 1px; background: var(--edge); margin: 10px 0; }
.kv-inline { font-size: 12px; color: #4A452C; }
.kv-inline b { color: var(--ink); }

.price      { font-weight: bold; font-variant-numeric: tabular-nums; }
.price-big  { font-size: 17px; font-weight: bold; font-variant-numeric: tabular-nums; }
.positive   { color: var(--ok); }
.negative   { color: var(--dead); }
.strike     { text-decoration: line-through; color: #6B6549; }

/* simple inline bar for price history cells */
.spark { display: inline-block; vertical-align: middle; }
.spark i {
  display: inline-block;
  width: 3px;
  margin-right: 1px;
  background: #6E86A0;
  vertical-align: bottom;
}

.pager { margin-top: 10px; text-align: center; font-size: 12px; }
.pager a, .pager span { margin: 0 4px; }
.pager .current { font-weight: bold; color: var(--ink); }

/* footer */
.site-foot {
  margin-top: 26px;
  text-align: center;
  font-size: 11px;
  color: #55503A;
}
.site-foot .links { margin-bottom: 6px; }
.site-foot .legal { max-width: 620px; margin: 8px auto 0; line-height: 1.5; }

/* empty-state */
.empty {
  padding: 18px 10px;
  text-align: center;
  color: #6B6549;
  font-style: italic;
  font-size: 12px;
}

/* honour-system notice */
.honour {
  background: #DCD6BC;
  border: 1px solid #C4B98A;
  padding: 8px 10px;
  font-size: 12px;
}
.honour b { color: #5A4514; }
