/* Mega Trade Machine — broadcast-graphic styling (black, bold condensed type, amber accent) */
:root {
  --bg: #0a0a0c;
  --panel: #141418;
  --panel2: #1b1b21;
  --panel3: #24242c;
  --line: #2c2c36;
  --text: #f4f4f6;
  --muted: #a2a2b0;
  --dim: #6d6d7a;
  --accent: #ffb000;
  --accent2: #ff8a00;
  --good: #3ddc97;
  --bad: #ff6b6b;
  --warn: #ffc94d;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --display: 'Anton', 'Impact', sans-serif;
  --r: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 500px at 50% -120px, #25201a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.back-link {
  position: fixed; top: 14px; left: 14px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  border-radius: 50px; text-decoration: none; font-weight: 600; font-size: .9em; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); backdrop-filter: blur(10px);
  transition: background .2s, transform .2s;
}
.back-link:hover { background: rgba(255,255,255,.16); transform: translateY(-2px); }

/* ---------- header ---------- */
.top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1500px; margin: 0 auto; padding: 30px 24px 14px;
  border-bottom: 6px solid var(--accent);
}
.wordmark { font-family: var(--display); font-size: clamp(44px, 7vw, 84px); line-height: .9; letter-spacing: .01em; display: flex; align-items: center; gap: .12em; text-transform: uppercase; }
.wordmark .arrows { color: var(--accent); font-family: var(--body); font-weight: 700; font-size: .8em; transform: translateY(-.04em); }
.wordmark .accent { color: var(--accent); }
.tagline { font-family: var(--cond); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 8px; font-size: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  font-family: var(--cond); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 15px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 9px 16px; border-radius: 8px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--panel3); border-color: #3a3a46; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.rate {
  background: linear-gradient(180deg, var(--accent), var(--accent2)); color: #111; border: 0; font-size: 22px; font-weight: 800; padding: 12px 34px; border-radius: 10px;
  box-shadow: 0 6px 24px rgba(255,160,0,.25);
}
.btn.rate:hover:not(:disabled) { background: linear-gradient(180deg, #ffc233, var(--accent)); }
.btn:focus-visible, .asset:focus-visible, .club-pick:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- club strip ---------- */
.club-strip { max-width: 1500px; margin: 0 auto; padding: 14px 24px 6px; }
.strip-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.strip-top .strip-label { margin-bottom: 0; }
.find { background: #0c0c10; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; color: var(--text); font: inherit; font-size: 14px; width: min(280px, 100%); }
.find:focus { border-color: var(--accent); outline: none; }
.asset.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(255,176,0,.28); } 100% { background: none; } }
.strip-label { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.strip { display: flex; flex-wrap: wrap; gap: 8px; }
.club-pick {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 66px; padding: 6px 2px 5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: transform .12s, border-color .12s, background .12s;
}
.club-pick:hover { transform: translateY(-2px); border-color: #444452; }
.club-pick .abbr { font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .04em; color: var(--muted); }
.club-pick.in { background: #2a2210; border-color: var(--accent); }
.club-pick.in .abbr { color: var(--accent); }
.club-pick.in::after { content: '✓'; position: absolute; top: 2px; right: 5px; font-size: 11px; color: var(--accent); font-weight: 700; }

/* ---------- layout ---------- */
.layout { max-width: 1500px; margin: 0 auto; padding: 14px 24px 30px; display: grid; grid-template-columns: minmax(330px, 420px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } .browser { position: static !important; max-height: none !important; order: 2; } }

/* ---------- list browser ---------- */
.browser { position: sticky; top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.tabs { display: flex; gap: 2px; overflow-x: auto; background: #0f0f13; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tab { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; font-family: var(--cond); font-weight: 700; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); background: var(--panel); }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.browser-body { overflow-y: auto; flex: 1; }
.empty-browser { padding: 26px 20px; color: var(--muted); text-align: center; }

.club-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--club, #333) 0%, transparent 85%); }
.club-head .row1 { display: flex; align-items: center; gap: 12px; }
.club-head h2 { margin: 0; font-family: var(--cond); font-weight: 800; font-size: 26px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.club-head .sub { color: #d6d6de; font-size: 13px; margin-top: 3px; }
.persp { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.persp .lbl { font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; background: #0c0c10; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .03em; color: var(--muted); }
.seg button.on { background: var(--accent); color: #111; }

.filters { display: flex; gap: 6px; padding: 10px 16px 6px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1 1 140px; min-width: 120px; background: #0c0c10; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color: var(--text); font: inherit; font-size: 14px; }
.chipf { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 20px; padding: 3px 10px; cursor: pointer; font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.chipf.on { border-color: var(--accent); color: var(--accent); }
.sortby { background: #0c0c10; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); padding: 5px 6px; font-family: var(--cond); font-weight: 600; }

.section-h { font-family: var(--cond); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--accent); padding: 12px 16px 6px; display: flex; justify-content: space-between; }
.section-h span:last-child { color: var(--dim); font-weight: 600; }

.asset {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 7px 14px 7px 12px; background: none; border: 0; border-top: 1px solid #1f1f27; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.asset:hover { background: #1d1d24; }
.asset.used { opacity: .38; cursor: default; }
.asset .no { font-family: var(--cond); font-weight: 700; color: var(--dim); font-size: 15px; text-align: right; }
.asset .nm { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.asset .nm span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset .meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.asset .val { text-align: right; }
.asset .pts { font-family: var(--cond); font-weight: 700; font-size: 16px; }
.asset .eq { font-size: 11px; color: var(--dim); }
.ovr { display: inline-block; min-width: 26px; text-align: center; font-family: var(--cond); font-weight: 800; font-size: 12px; border-radius: 4px; padding: 0 4px; color: #111; }
.tag { display: inline-block; font-family: var(--cond); font-weight: 700; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; padding: 0 5px; line-height: 16px; border: 1px solid; white-space: nowrap; }
.tag.fa { color: var(--warn); border-color: rgba(255,201,77,.45); }
.tag.rk { color: var(--muted); border-color: #3a3a46; }
.tag.in { color: var(--accent); border-color: rgba(255,176,0,.5); }
.info-btn { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0 2px; font-size: 13px; }
.info-btn:hover { color: var(--accent); }
.pick-row .no { font-size: 13px; color: var(--accent); }

/* ---------- board (mirrors the graphic) ---------- */
.board { border-radius: 16px; overflow: hidden; background: #000; border: 1px solid #222; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.board-head { display: grid; grid-template-columns: 110px 1fr 1fr; background: #000; border-bottom: 5px solid var(--accent); }
.board-head div { font-family: var(--display); font-size: 30px; text-align: center; padding: 8px 0 6px; letter-spacing: .02em; }
.brow { display: grid; grid-template-columns: 110px 1fr 1fr; min-height: 118px; background: var(--club); position: relative; border-top: 4px solid #000; }
.brow::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(0,0,0,.05) 40%, rgba(0,0,0,.25)); pointer-events: none; }
.brow .who { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; position: relative; padding: 8px 4px; }
.brow .who .nm { font-family: var(--cond); font-weight: 800; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,.6); text-align: center; line-height: 1.05; }
.brow .who .x { position: absolute; top: 4px; left: 6px; border: 0; background: rgba(0,0,0,.35); color: #fff; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 22px; padding: 0; opacity: 0; transition: opacity .15s; }
.brow:hover .who .x, .brow .who .x:focus-visible { opacity: 1; }
.cell { position: relative; padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-left: 3px solid rgba(0,0,0,.55); min-height: 100%; transition: background .12s, box-shadow .12s; }
.cell .hint { font-family: var(--cond); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.55); text-align: center; }
.cell.drop-ok { background: rgba(255,176,0,.18); box-shadow: inset 0 0 0 3px var(--accent); }
.cell.drop-bad { background: rgba(255,80,80,.14); }
.bchip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; position: relative;
  font-family: var(--cond); font-weight: 800; font-size: 21px; letter-spacing: .02em; text-transform: uppercase; line-height: 1.05; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.55); cursor: grab; padding: 1px 4px; border-radius: 6px; user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.bchip:hover { background: rgba(0,0,0,.25); }
.bchip .v { font-family: var(--body); font-weight: 600; font-size: 11.5px; text-transform: none; letter-spacing: 0; color: rgba(255,255,255,.8); text-shadow: none; background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 10px; white-space: nowrap; }
.bchip .dest { white-space: nowrap; font-size: 13px; background: #000; color: var(--accent); border-radius: 4px; padding: 1px 5px; text-shadow: none; cursor: pointer; border: 0; font-family: var(--cond); font-weight: 800; }
.bchip .rm { border: 0; background: rgba(0,0,0,.5); color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; line-height: 18px; padding: 0; cursor: pointer; opacity: 0; }
.bchip:hover .rm, .bchip .rm:focus-visible { opacity: 1; }
.board-empty { padding: 40px 24px; text-align: center; background: linear-gradient(180deg, #111, #0a0a0a); }
.board-empty h3 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 0 0 8px; letter-spacing: .01em; }
.board-empty p { color: var(--muted); margin: 0 auto 18px; max-width: 520px; }
.board-actions { display: flex; gap: 10px; align-items: center; margin: 16px 0 6px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .top { padding: 24px 16px 12px; }
  .club-strip, .layout { padding-left: 16px; padding-right: 16px; }
  .club-pick { width: calc((100% - 40px) / 6); }
  .board-head, .brow { grid-template-columns: 70px 1fr 1fr; }
  .board-head div { font-size: 22px; }
  .bchip { font-size: 16px; }
  .brow .who .nm { font-size: 11px; }
  .cell { padding: 8px 5px; }
}

/* ---------- warnings + results ---------- */
.warnings { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.warn { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; background: #1d1810; border: 1px solid #4a3a14; color: #f2dfae; padding: 8px 12px; border-radius: 8px; }
.warn.info { background: #11161d; border-color: #24344a; color: #c4d4ea; }
.warn b { color: #fff; }

.results { margin-top: 16px; }
.verdict { background: #000; border-radius: 16px; overflow: hidden; border: 1px solid #222; }
.verdict-top { padding: 18px 22px 16px; border-bottom: 5px solid var(--accent); display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.verdict-top .kicker { font-family: var(--cond); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-size: 13px; }
.verdict-top h3 { margin: 2px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 3.6vw, 40px); line-height: 1.02; letter-spacing: .01em; }
.verdict-top p { margin: 6px 0 0; color: var(--muted); max-width: 780px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: #222; }
.card { background: var(--panel); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.card-top { display: flex; align-items: center; gap: 12px; }
.card-top .nm { font-family: var(--cond); font-weight: 800; font-size: 22px; text-transform: uppercase; line-height: 1; }
.card-top .persp-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.grade { margin-left: auto; font-family: var(--display); font-size: 50px; line-height: .9; min-width: 64px; text-align: right; }
.g-a { color: var(--good); } .g-b { color: #cde86b; } .g-c { color: var(--warn); } .g-d { color: #ff9a5c; } .g-f { color: var(--bad); }
.netline { font-family: var(--cond); font-weight: 700; font-size: 19px; }
.netline small { font-family: var(--body); font-weight: 500; font-size: 13px; color: var(--muted); }
.bars { display: grid; grid-template-columns: 40px 1fr 70px; gap: 4px 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.bar { height: 10px; background: #2a2a33; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; }
.bar.in i { background: var(--good); } .bar.out i { background: var(--bad); }
.bars .n { text-align: right; font-family: var(--cond); font-weight: 700; color: var(--text); font-size: 14px; }
.reasons { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: #d7d7df; }
.reasons li::marker { color: var(--accent); }
.market-note { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.verdict-foot { padding: 12px 22px 16px; font-size: 13px; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line); }

/* ---------- menu, modal, toast, drag ghost ---------- */
.menu { position: fixed; z-index: 80; background: #16161c; border: 1px solid #3a3a46; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.6); padding: 6px; min-width: 220px; max-width: min(360px, calc(100vw - 20px)); max-height: 70vh; overflow-y: auto; }
.menu .mh { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: 12px; padding: 6px 10px 4px; }
.menu button.mi { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 7px; padding: 7px 10px; cursor: pointer; font-weight: 600; }
.menu button.mi:hover, .menu button.mi:focus-visible { background: #262630; outline: none; }
.menu button.mi small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.7); display: flex; align-items: flex-start; justify-content: center; padding: 40px 14px; overflow-y: auto; }
.modal-card { position: relative; background: var(--panel); border: 1px solid #33333e; border-radius: 16px; max-width: 760px; width: 100%; padding: 24px 26px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 28px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal h2 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 0 0 4px; letter-spacing: .01em; line-height: 1.05; }
.modal h3 { font-family: var(--cond); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: 17px; color: var(--accent); margin: 20px 0 6px; }
.modal p, .modal li { color: #d8d8e0; }
.modal table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.modal th, .modal td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.modal th:first-child, .modal td:first-child { text-align: left; }
.modal th { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-size: 12.5px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.pstat { background: #0f0f13; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pstat .k { font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-size: 11.5px; }
.pstat .v { font-family: var(--cond); font-weight: 800; font-size: 22px; line-height: 1.1; }
.spark { width: 100%; height: 90px; display: block; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #16161c; border: 1px solid var(--accent); color: var(--text); padding: 10px 18px; border-radius: 10px; z-index: 100; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.ghost-drag { position: fixed; z-index: 120; pointer-events: none; background: #1e1e25; border: 1px solid var(--accent); color: var(--text); border-radius: 8px; padding: 6px 12px; font-family: var(--cond); font-weight: 800; font-size: 17px; text-transform: uppercase; letter-spacing: .03em; box-shadow: 0 10px 30px rgba(0,0,0,.6); transform: translate(-50%, -120%); white-space: nowrap; }
body.dragging, body.dragging * { cursor: grabbing !important; }

.foot { max-width: 1500px; margin: 0 auto; padding: 10px 24px 40px; color: var(--dim); font-size: 12.5px; }
