* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --red: #e10600; --ink: #111; --paper: #f4f1ea; }
body { background: var(--paper); color: var(--ink); font-family: "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif; }
.mono { font-family: "Courier New", monospace; }

.masthead { background: var(--ink); color: #fff; padding: 18px 16px 12px; border-bottom: 6px solid var(--red); }
.logo { font-size: 42px; letter-spacing: 2px; line-height: 1; }
.logo span { color: var(--red); }
.tagline { margin-top: 6px; font-family: "Courier New", monospace; font-size: 13px; color: #ccc; }

.ticker { background: var(--red); color: #fff; overflow: hidden; white-space: nowrap; border-bottom: 3px solid var(--ink); }
.ticker-inner { display: inline-block; padding: 6px 0; font-family: "Courier New", monospace; font-size: 13px; animation: tick 30s linear infinite; }
@keyframes tick { from { transform: translateX(100%);} to { transform: translateX(-100%);} }

.mode-tabs { display: flex; border-bottom: 3px solid var(--ink); }
.tab { flex: 1; background: #ddd6c8; border: none; border-right: 3px solid var(--ink); padding: 12px 8px; font-size: 20px; font-weight: 900; cursor: pointer; text-align: center; }
.tab:last-child { border-right: none; }
.tab small { display: block; font-size: 11px; font-weight: 400; font-family: "Courier New", monospace; margin-top: 4px; }
.tab.active { background: var(--ink); color: #fff; }
.tab.active small { color: var(--red); }

.statusbar { background: #fff; border-bottom: 3px solid var(--ink); padding: 10px 16px; font-family: "Courier New", monospace; font-size: 13px; }
.statusbar b { color: var(--red); }

.board-switch { display: flex; gap: 0; border-bottom: 3px solid var(--ink); }
.board-btn { flex: 1; padding: 10px; font-size: 16px; font-weight: 900; background: var(--red); color: #fff; border: none; cursor: pointer; }
.board-btn.paid { background: #999; color: #eee; cursor: not-allowed; }

.controls { padding: 12px 16px; background: #fff; border-bottom: 3px solid var(--ink); }
#search { width: 100%; padding: 12px; font-size: 16px; border: 3px solid var(--ink); background: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { border: 2px solid var(--ink); background: #fff; padding: 4px 10px; font-size: 13px; cursor: pointer; font-weight: 700; }
.chip.active { background: var(--ink); color: #fff; }

.list { padding: 8px 12px 24px; }
.row { position: relative; display: flex; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); margin: 12px 0; padding: 12px; overflow: hidden; }
.rank { font-family: "Courier New", monospace; font-weight: 700; font-size: 22px; min-width: 44px; text-align: center; }
.rank.top { color: var(--red); }
.meta { flex: 1; min-width: 0; }
.name { font-size: 18px; font-weight: 900; word-break: break-word; }
.cat { font-family: "Courier New", monospace; font-size: 12px; color: #555; }
.votes { font-family: "Courier New", monospace; font-size: 22px; font-weight: 700; text-align: right; }
.votes small { display: block; font-size: 10px; color: #777; }
.vote-btn { background: var(--red); color: #fff; border: 3px solid var(--ink); padding: 12px 14px; font-size: 16px; font-weight: 900; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.vote-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.vote-btn.bonus { background: var(--ink); }
.vote-btn:disabled { background: #aaa; cursor: not-allowed; box-shadow: none; }

.stamp { position: absolute; right: 90px; top: 50%; transform: translateY(-50%) rotate(-12deg); border: 4px solid var(--red); color: var(--red); font-size: 22px; font-weight: 900; padding: 2px 10px; letter-spacing: 2px; background: rgba(255,255,255,.85); pointer-events: none; }
.stamp.bonus { border-color: var(--ink); color: var(--ink); }
.row.stamped { background: #f8e9e8; }
.row.flash { animation: rowflash .5s; }
@keyframes rowflash { 0% { background: var(--red);} 100% { background: #f8e9e8; } }

.stamp-flash[hidden] { display: none; }
.stamp-flash { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 900; color: var(--red); letter-spacing: 4px; background: rgba(255,255,255,.35); z-index: 50; pointer-events: none; }
.stamp-flash.show { animation: slam .6s ease-out; }
@keyframes slam { 0% { transform: scale(3) rotate(-20deg); opacity: 0;} 60% { transform: scale(.95) rotate(-12deg); opacity: 1;} 100% { transform: scale(1) rotate(-12deg); opacity: 1;} }

.share-panel { margin: 16px 12px; border: 3px solid var(--ink); background: var(--ink); color: #fff; padding: 16px; box-shadow: 6px 6px 0 var(--red); }
.share-panel h2 { color: var(--red); font-size: 22px; }
.share-panel p { font-family: "Courier New", monospace; font-size: 13px; margin: 8px 0; }
.share-actions { display: flex; gap: 10px; }
.share-actions button { flex: 1; padding: 12px; font-size: 16px; font-weight: 900; border: 3px solid #fff; background: var(--red); color: #fff; cursor: pointer; }
.share-actions button:last-child { background: #fff; color: var(--ink); border-color: var(--red); }
.fine { color: #aaa; font-size: 11px !important; }
.foot { padding: 16px; font-family: "Courier New", monospace; font-size: 12px; color: #666; text-align: center; }
.empty { text-align: center; padding: 40px 0; font-family: "Courier New", monospace; color: #666; }

@media (max-width: 600px) {
  .logo { font-size: 30px; letter-spacing: 1px; }
  .tab { font-size: 16px; padding: 10px 4px; }
  .row { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .rank { min-width: 30px; font-size: 18px; }
  .name { font-size: 16px; }
  .votes { margin-left: auto; font-size: 18px; }
  .vote-btn { flex: 1 1 100%; padding: 10px; font-size: 15px; }
  .stamp { right: 12px; top: 10px; transform: rotate(-12deg); }
  .stamp-flash { font-size: 40px; letter-spacing: 2px; }
  .share-actions { flex-direction: column; }
  .statusbar { font-size: 12px; word-break: break-word; }
}

/* ---- HCX market flavor ---- */
.sym { font-family: "Courier New", monospace; font-size: 12px; background: var(--ink); color: #ffd94d; padding: 2px 6px; vertical-align: middle; }
.mkt { font-size: 13px; margin-top: 3px; }
.mcap { color: #777; }
.chg-up { color: #c40000; font-weight: 700; }
.chg-dn { color: #0a7d2c; font-weight: 700; }
.chev { font-size: 30px; font-weight: 900; color: #bbb; padding: 0 2px; }
.row { cursor: pointer; }
.mkt-head { display: flex; justify-content: space-between; padding: 10px 16px 0; font-family: "Courier New", monospace; font-size: 11px; color: #666; letter-spacing: 1px; }
.mkt-r { text-align: right; }

/* ---- Olympic podium, top 3 ---- */
.podium-wrap { background: #fff; border-bottom: 3px solid var(--ink); padding: 12px 12px 0; }
.podium-head { font-weight: 900; font-size: 18px; letter-spacing: 1px; }
.podium-head span { float: right; font-family: "Courier New", monospace; font-size: 11px; color: var(--red); margin-top: 4px; }
.podium { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.3fr) minmax(0,1fr); align-items: end; gap: 8px; margin-top: 12px; }
.pod { text-align: center; border: 3px solid var(--ink); border-bottom: none; background: var(--paper); padding: 10px 4px 0; cursor: pointer; display: flex; flex-direction: column; }
.pod-medal { font-size: 30px; }
.pod-name { font-weight: 900; font-size: 14px; line-height: 1.2; min-height: 34px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pod-sym { font-size: 11px; margin-top: 2px; }
.pod-votes { font-size: 20px; font-weight: 700; margin-top: 4px; }
.pod-votes small { font-size: 10px; color: #777; }
.pod-bar { margin-top: auto; color: #fff; font-weight: 900; font-size: 16px; padding: 4px 0; display: flex; align-items: flex-start; justify-content: center; }
.p1 { grid-column: 2; grid-row: 1; background: #fff6d8; }
.p1 .pod-bar { background: #d4a017; height: 58px; }
.p2 { grid-column: 1; grid-row: 1; }
.p2 .pod-bar { background: #8a8f98; height: 40px; }
.p3 { grid-column: 3; grid-row: 1; }
.p3 .pod-bar { background: #b0662a; height: 28px; }
.p1 .pod-medal { font-size: 38px; }

/* ---- Company action sheet ---- */
.sheet-back { position: fixed; inset: 0; background: rgba(10,10,10,.55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back[hidden] { display: none; }
.sheet { background: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--red); width: 100%; max-width: 520px; padding: 18px 16px 14px; position: relative; max-height: 88vh; overflow: auto; }
.sheet-x { position: absolute; right: 10px; top: 8px; border: 3px solid var(--ink); background: #fff; width: 36px; height: 36px; font-weight: 900; cursor: pointer; }
.sheet-name { font-size: 26px; font-weight: 900; padding-right: 44px; line-height: 1.1; }
.sheet-tick { font-family: "Courier New", monospace; font-size: 12px; color: #555; margin-top: 4px; }
.sheet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.sheet-stats > div { border: 2px solid var(--ink); background: #fff; padding: 8px 10px; }
.sheet-stats small { display: block; font-family: "Courier New", monospace; font-size: 10px; color: #777; letter-spacing: 1px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.act { border: 3px solid var(--ink); padding: 14px; font-size: 18px; font-weight: 900; cursor: pointer; text-align: left; box-shadow: 4px 4px 0 var(--ink); }
.act small { display: block; font-family: "Courier New", monospace; font-weight: 400; font-size: 11px; margin-top: 2px; }
.act.free { background: var(--red); color: #fff; }
.act.bonus { background: var(--ink); color: #fff; }
.act.pay { background: #ffd94d; color: var(--ink); cursor: not-allowed; box-shadow: none; }
.act.done { background: #aaa; color: #eee; cursor: not-allowed; box-shadow: none; }
.sheet-fine { font-family: "Courier New", monospace; font-size: 11px; color: #666; margin-top: 12px; }
@media (max-width: 600px) { .pod-name { font-size: 12px; } .pod-votes { font-size: 16px; } .mkt { font-size: 12px; } .chev { display: none; } }

.logo-img { width: 22px; height: 22px; vertical-align: -5px; margin-right: 7px; background: #fff; }
.pod-logo { width: 26px; height: 26px; display: block; margin: 2px auto 4px; }
.stamp-flash.mega { font-size: 96px; color: #fff; background: rgba(225,6,0,.75); letter-spacing: 6px; }
body.shake { animation: bshake .4s; }
body.shake-mega { animation: bshake .9s; }
@keyframes bshake { 0%,100%{transform:translate(0)} 20%{transform:translate(-8px,3px) rotate(-.4deg)} 40%{transform:translate(7px,-4px)} 60%{transform:translate(-6px,-2px) rotate(.4deg)} 80%{transform:translate(5px,3px)} }
@media (max-width: 600px) { .stamp-flash.mega { font-size: 54px; } }

.mood { color: var(--red); font-weight: 700; font-size: 11px; }

body { overflow-x: hidden; }
.real { background: #0a7d2c; color: #fff; font-size: 10px; padding: 1px 5px; font-weight: 700; }
.hcx { background: #999; color: #fff; font-size: 10px; padding: 1px 5px; font-weight: 700; }

.pod { min-width: 0; overflow: hidden; }
.pod-sym, .pod-votes { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-name { overflow-wrap: anywhere; }

.pod-medal { min-height: 44px; } .pod-sym { min-height: 18px; } .pod-votes { min-height: 28px; }
