/* COFL's site on Dragsim's data. bootstrap-dark.css is the same theme it uses; this adds its layouts.
   The numbers are read off the live page: #222 page, #303030 cards with #444 borders and a 20px
   radius, #375a7f buttons, and monospace bold item names on auction cards. */
:root { --rail: 80px; }
html, body { background: #222; color: #fff; overflow-x: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; }
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
.link { color: #3498db; }
.link:hover { color: #6bb5e6; text-decoration: underline; }
hr { border-color: #555; opacity: 1; margin: 10px 0; }
::-webkit-scrollbar { width: 12px; background: #272b30; }
::-webkit-scrollbar-thumb { background: #3a3f44; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #7a8288; }

#rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); z-index: 20;
  display: flex; flex-direction: column; align-items: stretch;
  background: #1d1d1d; overflow: hidden; transition: width .15s;
}
#rail:hover { width: 230px; box-shadow: 2px 0 12px rgba(0,0,0,.5); }
#rail .logo { display: flex; align-items: center; gap: 26px; height: 88px; padding: 0 22px; border-bottom: 1px solid #444; white-space: nowrap; font-weight: bold; letter-spacing: .5px; }
#rail .logo svg { flex: 0 0 36px; }
#rail a.item { display: flex; align-items: center; gap: 32px; height: 50px; padding: 0 28px; white-space: nowrap; color: #fff; }
#rail a.item:hover { background: #505050; }
#rail a.item.on { background: #2c4866; }
#rail a.item svg { flex: 0 0 24px; }

#shell { margin-left: var(--rail); min-height: 100vh; display: flex; flex-direction: column; }
#bar { display: flex; align-items: center; gap: 12px; padding: 20px 32px 8px; }
#burger { display: none; background: none; border: 0; color: inherit; padding: 0; cursor: pointer; }
.search { position: relative; flex: 1; }
.search input { width: 100%; height: 38px; padding: 6px 16px; color: #fff; background: #303030; border: 0; border-radius: 10px; font: inherit; }
.search input:focus { outline: 2px solid #375a7f; }
.search input::placeholder { color: #999; }
#results { position: absolute; left: 0; right: 0; top: 42px; z-index: 15; max-height: 60vh; overflow: auto; background: #303030; border: 1px solid #444; border-radius: 10px; }
#results a { display: flex; gap: 12px; align-items: center; padding: 8px 14px; }
#results a:hover { background: #444; }
#results img, #results .noicon { width: 32px; height: 32px; margin: 0; }
#results a.previous span:last-child { color: #c389f6; }

main { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 14px 32px 50px; }
.link-shell { max-width: 650px; padding-top: clamp(32px, 12vh, 120px); }
#notifyDelivery .controls { flex-wrap: wrap; }
#notifyWebhook { width: min(340px, 100%); }
footer { padding: 0 32px 24px; color: #888; font-size: 13px; text-align: center; }
h1.page { font-size: 2.2rem; font-weight: 700; margin: 8px 0 18px; }
h2.section { font-size: 1.5rem; font-weight: 700; margin: 30px 0 12px; }
.mono { font-family: monospace; font-weight: bold; }
.lime { color: lime; }
.red { color: #ff4d4d; }
.gold { color: gold; }

.head-img { width: 32px; height: 32px; border-radius: 3px; image-rendering: pixelated; vertical-align: middle; }
.item-img { width: 48px; height: 48px; margin-right: 10px; object-fit: contain; image-rendering: pixelated; vertical-align: middle; }
.noicon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-right: 10px; background: #3a3a3a; border-radius: 6px; color: #bbb; font-weight: bold; vertical-align: middle; }

/* Auctions | Bids, and the chart's range buttons */
.toggle { display: flex; width: 100%; margin: 10px 0 14px; border-radius: 6px; overflow: hidden; }
.toggle button { flex: 1; padding: 7px 10px; border: 0; color: #fff; background: #444; font: inherit; cursor: pointer; }
.toggle button:hover { background: #505050; }
.toggle button.on { background: #2c4866; }

/* Player auctions: COFL's two column cards */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 15px 18px; }
.auction { display: block; background: #303030; border: 1px solid #444; border-radius: 20px; padding: 8px 16px; color: #fff; }
.auction:hover { background: #383838; color: #fff; }
.auction h4 { display: flex; align-items: center; flex-wrap: wrap; gap: 0 10px; font-family: monospace; font-weight: bold; font-size: 1.15rem; margin: 6px 0 8px; }
.auction h4 .item-img, .auction h4 .noicon { margin-right: 0; }
.auction p { margin: 0 0 6px; }
.auction .parts { color: #aaa; font-size: 13px; }
.badge { font-size: 12px; vertical-align: middle; }

/* The cards under the chart */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.mini { display: block; background: #303030; border-radius: 6px; overflow: hidden; color: #fff; }
.mini:hover { background: #3a3a3a; color: #fff; }
.mini .top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #444; font-weight: 700; }
.mini .top img, .mini .top .noicon { width: 28px; height: 28px; margin: 0; }
.mini .body { padding: 10px 12px; }
.mini .who { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid #555; margin-bottom: 8px; min-width: 0; }
.mini .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .when { color: #ddd; font-size: 14px; }

/* Tracked flips */
.flip-total { font-size: 1.6rem; font-weight: 700; margin: 6px 0 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.controls { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; margin-bottom: 14px; }
.controls label { display: flex; align-items: center; gap: 10px; }
.controls select, .controls input { background: #303030; color: #fff; border: 1px solid #555; border-radius: 6px; padding: 5px 10px; font: inherit; }
.flip { background: #303030; border: 1px solid #444; border-radius: 20px; padding: 12px 18px; margin-bottom: 15px; }
.flip-title { display: flex; justify-content: space-between; gap: 14px; align-items: center; font-size: 1.25rem; font-weight: 600; margin: 0; }
.flip-title .it { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flip-title .it img, .flip-title .it .noicon { width: 36px; height: 36px; margin-right: 6px; }
.flip-prices { display: flex; align-items: center; justify-content: space-around; gap: 10px; margin: 6px 0; }
.price-box { flex: 0 1 340px; text-align: center; background: #444; border-radius: 6px; padding: 8px 12px; font-size: 1.15rem; font-weight: 500; }
.price-box small { display: block; color: #bbb; font-size: 12px; font-weight: 400; }
a.price-box:hover { background: #505050; }
.flip-meta { margin: 8px 0 4px; }
.flip-meta > * { margin-right: 14px; }
.flip table { max-width: 620px; margin: 2px 0 6px; }
.flip td { padding: 3px 12px 3px 0; border: 0; border-bottom: 1px solid #444; background: transparent; color: #fff; }
.flip .why { color: #aaa; font-size: 13px; }

/* Flipper */
.grid-deals { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.deal { background: #303030; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.deal .top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #444; }
.deal .top img, .deal .top .noicon { width: 28px; height: 28px; margin: 0; }
.deal .top .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; font-weight: bold; }
.deal .body { padding: 10px 14px; flex: 1; }
.deal .body p { margin: 0 0 8px; }
.deal .body b { display: block; }
.deal .foot { padding: 8px 14px 12px; }
.deal .copy { width: 100%; }

/* Item page */
.item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.item-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.item-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.item-title:hover h1 { text-decoration: underline; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 8px; }
.filter-row label { display: flex; align-items: center; gap: 8px; }
.filter-row[hidden] { display: none; }
.filter-row select { max-width: 200px; background: #303030; color: #fff; border: 1px solid #555; border-radius: 6px; padding: 4px 8px; font: inherit; }
.add-filter { background: none; border: 0; color: #fff; font: inherit; cursor: pointer; padding: 0; }
.chart { height: 50vh; min-height: 340px; width: 100%; margin: 8px 0 12px; }
.avg { text-align: center; margin-bottom: 14px; }
.panel { background: #303030; border-radius: 6px; padding: 14px 18px; margin: 16px 0; }
.panel h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px; }
.mod h3 { margin-top: 20px; }
.mod ol { padding-left: 22px; }
.mod li { margin-bottom: 6px; }
.mod .table td:first-child { white-space: nowrap; width: 1%; }
.download { display: inline-flex; align-items: center; gap: 6px; }
.mod .download { margin: 6px 0 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 24px; }
.stats b { display: block; font-size: 1.15rem; }
.stats span { color: #bbb; font-size: 13px; }
.table { color: #fff; margin-bottom: 0; }
.table th { color: #bbb; font-weight: 500; }
.table td, .table th { background: transparent; border-color: #444; color: inherit; }
.num { text-align: right; white-space: nowrap; }

/* Crafts */
.grid-crafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 15px 18px; }
.line { margin: 0 0 6px; }
.line > span:first-child { display: inline-block; width: 150px; color: #ccc; }
.check { cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #375a7f; }
.summary { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 16px; }
.summary div { flex: 1 1 220px; background: #303030; border-radius: 6px; padding: 12px 16px; }
.summary div > span:first-child { display: block; color: #bbb; font-size: 13px; }
.summary strong { font-size: 1.3rem; }
.step { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid #444; }
.step:last-child { border-bottom: 0; }
.step img, .step .noicon { width: 24px; height: 24px; margin-right: 6px; font-size: 12px; }
.step .what { min-width: 0; }
.step a:hover { text-decoration: underline; }
.step .how { display: block; color: #aaa; font-size: 13px; }
.sources { color: #aaa; font-size: 13px; }

/* Reported trades, drawn the way the game prints them */
.receipt { background: #1d1d1d; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; font-family: monospace; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.receipt .head { color: #55ff55; }
.receipt .plus { color: #55ff55; }
.receipt .minus { color: #ff5555; }
.receipt .coin { color: #ffaa00; }
.receipt .note { color: #aaa; font-family: inherit; margin-top: 6px; font-size: 13px; }
.receipt .meta { color: #888; font-size: 12px; margin-bottom: 4px; }

/* Notifier */
#rail a.item { position: relative; }
.dot { position: absolute; left: 42px; top: 7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e74c3c; color: #fff; font: 700 12px/18px sans-serif; text-align: center; }
.watch.hit { border-color: #2ecc71; }
.icon-btn { flex: none; padding: 4px; border: 0; background: none; color: #bbb; cursor: pointer; }
.icon-btn:hover { color: #ff4d4d; }
.spark { display: block; width: 100%; height: 50px; margin: 12px 0 8px; }
.spark polyline { fill: none; stroke: #22A7F0; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark line { stroke: #f4d03f; stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.hits { margin: 8px 0 0; color: #aaa; font-size: 13px; }

/* Start page */
.hero { text-align: center; padding: 20px 0 16px; }
.hero h1 { font-size: 2.3rem; font-weight: 700; }
.hero p { color: #bbb; max-width: 640px; margin: 0 auto; }
.news { background: #303030; border-left: 4px solid #3498db; border-radius: 4px; padding: 12px 18px; margin: 16px 0 26px; }
.news h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
.news p { margin: 0 0 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { display: block; background: #303030; border-radius: 6px; padding: 24px 16px; text-align: center; color: #fff; }
.tile:hover { background: #3a3a3a; color: #fff; }
.tile svg { margin-bottom: 8px; }
.tile b { display: block; font-size: 1.05rem; }
.tile span { color: #bbb; font-size: 14px; }
.hero[hidden] { display: none; }

/* Favorites: COFL's FavoriteItemsBar and FavoriteToggle, their numbers as they stand */
.fav-bar { margin: 1.5rem 0 1rem; padding: 1rem; background: rgba(28, 28, 28, .8); border-radius: 12px; border: 1px solid rgba(255, 255, 255, .05); display: flex; flex-direction: column; gap: .75rem; }
.fav-bar[hidden] { display: none; }
.fav-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.fav-head h2 { font-size: 1.25rem; margin: 0; }
.fav-meta { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: #a1a1aa; }
.fav-error { margin: 0; color: #f87171; font-size: .9rem; }
.fav-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; }
.fav-card { display: flex; justify-content: space-between; gap: .75rem; padding: .75rem; border-radius: 10px; background: linear-gradient(145deg, rgba(45, 45, 45, .9), rgba(25, 25, 25, .7)); border: 1px solid rgba(255, 255, 255, .06); }
.fav-link { display: flex; flex: 1; gap: .75rem; color: inherit; }
.fav-link:hover { color: inherit; }
.fav-link:hover .fav-name { text-decoration: underline; }
.fav-icon { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background: rgba(17, 17, 17, .6); }
.fav-icon .item-img, .fav-icon .noicon { width: 40px; height: 40px; margin: 0; }
.fav-details { display: flex; flex-direction: column; gap: .3rem; }
.fav-name { font-weight: 600; font-size: 1rem; color: #f4f4f5; }
.fav-stats { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.fav-delta { font-weight: 500; }
.fav-delta.up { color: #4ade80; }
.fav-delta.down { color: #f87171; }
.fav-pct { font-size: .85rem; }
.fav-actions { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: .5rem; flex-shrink: 0; }
.fav-actions .btn { display: inline-flex; align-items: center; gap: 4px; padding: .35rem .75rem; font-size: .85rem; }
.fav-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px; border: none; border-radius: 6px; background: transparent; color: #9da3af; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: color .2s ease, background-color .2s ease; }
.fav-toggle:hover, .fav-toggle:focus-visible { background-color: rgba(255, 255, 255, .06); color: #facc15; outline: none; }
.fav-toggle.active { color: #facc15; }
.fav-toggle.small { font-size: 1.1rem; padding: 2px; }
.skeleton { position: relative; display: inline-block; min-width: 90px; height: 1em; border-radius: 6px; background-color: rgba(255, 255, 255, .08); overflow: hidden; vertical-align: middle; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent); animation: shimmer 1.8s infinite; }
.badge-skeleton { height: 26px; min-width: 110px; border-radius: 999px; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
/* Under 768px the actions fold into a menu, as COFL's do */
.fav-more { display: none; position: relative; flex-shrink: 0; }
.fav-more-btn { display: flex; align-items: center; justify-content: center; padding: .5rem; border: none; border-radius: 8px; background: rgba(255, 255, 255, .08); color: #e4e4e7; cursor: pointer; transition: background-color .2s ease; }
.fav-more-btn:hover, .fav-more-btn:focus-visible { background: rgba(255, 255, 255, .12); }
.fav-menu { position: absolute; top: 100%; right: 0; z-index: 100; display: flex; flex-direction: column; gap: .25rem; min-width: 140px; margin-top: 4px; padding: .5rem; background: rgba(35, 35, 35, .98); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; box-shadow: 0 4px 20px rgba(0, 0, 0, .4); }
.fav-menu[hidden] { display: none; }
.fav-menu-item { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border: none; border-radius: 6px; background: transparent; color: #e4e4e7; font: inherit; font-size: .9rem; text-align: left; white-space: nowrap; cursor: pointer; transition: background-color .2s ease; }
.fav-menu-item:hover { background: rgba(255, 255, 255, .08); color: #e4e4e7; }
@media (max-width: 768px) {
  .fav-bar { padding: .75rem; }
  .fav-list { grid-template-columns: 1fr; }
  .fav-link, .fav-details { min-width: 0; overflow: hidden; }
  .fav-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fav-actions { display: none; }
  .fav-more { display: flex; }
}

@media (max-width: 760px) {
  :root { --rail: 0px; }
  #rail { width: 230px; left: -240px; transition: left .2s; }
  #rail.open, #rail:hover { left: 0; width: 230px; }
  #burger { display: block; }
  #bar { padding: 12px 14px 6px; }
  main { padding: 10px 14px 40px; }
  footer { padding: 0 14px 20px; }
  .grid-2, .grid-crafts { grid-template-columns: 1fr; }
  h1.page, .hero h1 { font-size: 1.7rem; }
  .flip-prices { flex-direction: column; }
  .price-box { width: 100%; flex: none; }
  .flip-prices svg { transform: rotate(90deg); }
  .flip-title { flex-direction: column; align-items: flex-start; gap: 4px; }
  .chart { height: 320px; min-height: 0; }
}
