﻿:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --ink: #171611;
  --muted: #6c665a;
  --line: #dfd6c7;
  --panel: #fffdf8;
  --gold: #c9952c;
  --gold-dark: #7d5512;
  --green: #24835d;
  --red: #c74732;
  --blue: #3d6a91;
  --shadow: 0 20px 60px rgba(68, 49, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(16px, 3vw, 34px);
  background: rgba(247, 244, 238, 0.88);
  border-bottom: 1px solid rgba(223, 214, 199, 0.8);
  backdrop-filter: blur(16px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(178px, 18vw, 226px);
  height: auto;
  object-fit: contain;
}

.nav {
  gap: 18px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

main {
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  align-items: start;
  gap: 14px;
  padding: 14px 0 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 52px);
}

h2 {
  font-size: clamp(20px, 2vw, 28px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: var(--ink);
  color: #fff7df;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
}

.button.full {
  width: 100%;
}

.today-card,
.stats-grid article,
.vote-panel,
.results-panel {
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-main {
  min-width: 0;
}

.label,
.stats-grid span,
.consensus-card > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.today-card strong,
.stats-grid strong,
.consensus-card strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.1;
}

.direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  vertical-align: middle;
}

.direction.large {
  font-size: inherit;
  gap: 10px;
}

.direction.large .direction-icon {
  width: 32px;
  height: 32px;
  font-size: 21px;
}

.direction-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.direction-up {
  color: var(--green);
}

.direction-up .direction-icon {
  background: var(--green);
  color: #fff;
}

.direction-down {
  color: var(--red);
}

.direction-down .direction-icon {
  background: var(--red);
  color: #fff;
}

.direction-flat {
  color: var(--blue);
}

.direction-flat .direction-icon {
  background: var(--blue);
  color: #fff;
}

.today-card .direction {
  color: #fff7df;
}

.today-card .direction-up .direction-icon {
  background: #32a978;
}

.today-card .direction-down .direction-icon {
  background: #e25b45;
}

.today-card .direction-flat .direction-icon {
  background: #74a0c3;
}

.stats-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.today-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 18px;
  padding: 16px;
  background: var(--ink);
  color: #fff7df;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.today-card .label,
.today-card p {
  color: rgba(255, 247, 223, 0.78);
}

.today-card strong {
  font-size: clamp(42px, 5vw, 64px);
}

.today-card p {
  margin: 8px 0 0;
}

.forecast-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  grid-column: 1 / -1;
  max-width: 100%;
  margin-top: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 247, 223, 0.18);
  border-radius: 999px;
  color: rgba(255, 247, 223, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.forecast-rule strong {
  display: inline;
  margin: 0;
  color: #f3c969;
  font-size: inherit;
  line-height: inherit;
}

.forecast-rule span:last-child strong {
  color: #58d49b;
}

.mobile-market-strip {
  display: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.stats-grid article {
  padding: 14px;
}

.method {
  padding: 24px 0;
}

.history-table-section {
  padding: 18px 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.section-heading.compact {
  align-items: center;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
}

.hit {
  background: var(--green);
}

.miss {
  background: var(--red);
}

.pending {
  background: #9c9383;
}

.chart-wrap {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.comment-barrage {
  position: absolute;
  inset: 14px 18px auto 18px;
  height: 102px;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
  contain: paint;
}

.barrage-item {
  position: absolute;
  right: 0;
  max-width: min(520px, 74%);
  padding: 6px 12px;
  border: 1px solid rgba(201, 149, 44, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.88);
  color: #3f382e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  box-shadow: 0 8px 24px rgba(68, 49, 18, 0.1);
  animation: barrage-move 18s linear infinite;
}

.barrage-item.row-0 {
  top: 4px;
}

.barrage-item.row-1 {
  top: 38px;
}

.barrage-item.row-2 {
  top: 72px;
}

@keyframes barrage-move {
  from {
    transform: translateX(110%);
  }
  to {
    transform: translateX(calc(-100vw - 100%));
  }
}

#price-chart {
  display: block;
  width: 100%;
  height: min(62vh, 640px);
  min-height: 560px;
}

.comment-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.comment-form input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.comment-count {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.comment-count[hidden] {
  display: none;
}

.comment-count.over-limit,
.form-message.error {
  color: var(--red);
}

.comment-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.now-marker {
  cursor: default;
}

.now-marker g,
.now-marker line,
.now-marker circle {
  pointer-events: visiblePainted;
}

.now-majority-label {
  filter: drop-shadow(0 5px 12px rgba(68, 49, 18, 0.12));
}

.now-majority-label text {
  paint-order: stroke;
  stroke: #fffdf8;
  stroke-width: 3px;
}

.tooltip {
  position: absolute;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171611;
  color: #fff7df;
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.dashboard-side {
  display: grid;
  align-content: start;
  gap: 10px;
}

.vote-panel,
.results-panel {
  padding: 16px;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 12px 14px;
  border: 1px dashed rgba(108, 102, 90, 0.36);
  border-radius: 0;
  background-color: rgba(255, 253, 248, 0.7);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(108, 102, 90, 0.08) 0,
    rgba(108, 102, 90, 0.08) 10px,
    transparent 10px,
    transparent 22px
  );
  color: var(--muted);
  box-shadow: none;
}

.ad-slot span {
  color: rgba(61, 106, 145, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.muted,
.form-message,
.risk,
.data-note {
  color: var(--muted);
}

.vote-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.vote-deadline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.vote-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf6e9;
}

.vote-status span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.vote-status strong {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.vote-status .direction {
  color: var(--ink);
}

.vote-status .direction-icon {
  width: 24px;
  height: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.vote-status.done {
  border-color: rgba(36, 131, 93, 0.35);
  background: rgba(36, 131, 93, 0.1);
}

.vote-status.closed {
  border-color: rgba(108, 102, 90, 0.28);
  background: rgba(108, 102, 90, 0.08);
  color: var(--muted);
}

.data-note {
  margin: 0 0 12px;
  font-size: 13px;
}

input[type="text"],
input:not([type]) {
  width: 100%;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 10px;
}

.choice-grid label {
  cursor: pointer;
  min-width: 0;
}

.choice-grid input {
  position: absolute;
  opacity: 0;
}

.choice-grid > label > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
  line-height: 1;
}

.choice-grid label:has(input[value="up"]) > span {
  color: var(--green);
}

.choice-grid label:has(input[value="down"]) > span {
  color: var(--red);
}

.choice-grid label:has(input[value="flat"]) > span {
  color: var(--blue);
}

.choice-grid input:checked + span {
  border-color: var(--ink);
  background: #fff0c6;
}

.vote-form-closed .choice-grid label {
  cursor: not-allowed;
}

.vote-form-closed .choice-grid > label > span {
  border-color: rgba(108, 102, 90, 0.24);
  background: #f0ede6;
  color: #8b8578;
  opacity: 1;
}

.vote-form-closed .choice-grid label:has(input[value="up"]) > span,
.vote-form-closed .choice-grid label:has(input[value="down"]) > span,
.vote-form-closed .choice-grid label:has(input[value="flat"]) > span {
  color: #8b8578;
}

.vote-form-closed .direction-icon {
  background: #9c9383;
  color: #fffdf8;
}

.vote-form-closed .button.primary {
  border-color: #8b8578;
  background: #8b8578;
  color: #fffdf8;
  cursor: not-allowed;
  flex-direction: column;
  gap: 3px;
  line-height: 1.15;
}

.closed-next-vote {
  color: #ffd84d;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(23, 22, 17, 0.24);
}

.form-message {
  min-height: 0;
  margin: 8px 0 0;
  font-size: 14px;
}

.comment-panel .form-message:empty {
  display: none;
}

.vote-form-complete {
  margin-top: 12px;
}

.vote-confirmation {
  padding: 14px;
  border: 1px solid rgba(36, 131, 93, 0.25);
  border-radius: 8px;
  background: rgba(36, 131, 93, 0.08);
}

.vote-confirmation strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.vote-confirmation p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.vote-confirmation .next-vote-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(36, 131, 93, 0.18);
  color: var(--green);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bars {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 58px;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.bar-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece4d6;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 280ms ease;
}

.bar-fill.up {
  background: var(--green);
}

.bar-fill.down {
  background: var(--red);
}

.bar-fill.flat {
  background: var(--blue);
}

.consensus-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf6e9;
}

.consensus-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.consensus-card .direction {
  margin-top: 8px;
  justify-content: flex-start;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.compare-close {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.compare-close strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.compare-close span {
  color: var(--ink);
}

.waiting-move {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.status.hit {
  background: rgba(36, 131, 93, 0.12);
  color: var(--green);
}

.status.miss {
  background: rgba(199, 71, 50, 0.12);
  color: var(--red);
}

.status.pending {
  background: rgba(61, 106, 145, 0.12);
  color: var(--blue);
}

.split-meter {
  display: flex;
  width: 150px;
  height: 12px;
  overflow: hidden;
  border-radius: 0;
  background: #ece4d6;
  box-shadow: inset 0 0 0 1px rgba(23, 22, 17, 0.06);
}

.split-meter.empty {
  opacity: 0.5;
}

.split-segment {
  min-width: 0;
  height: 100%;
}

.split-segment + .split-segment {
  box-shadow: inset 2px 0 0 #fffdf8;
}

.split-segment.up {
  background: #0f7a4f;
}

.split-segment.down {
  background: #d94b35;
}

.split-segment.flat {
  background: #285f91;
}

.method {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 24px;
  border-top: 1px solid var(--line);
}

.method p {
  margin: 0;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--ink);
}

.legal-dialog {
  width: min(640px, calc(100% - 32px));
  max-height: min(82vh, 720px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.legal-dialog::backdrop {
  background: rgba(23, 22, 17, 0.42);
  backdrop-filter: blur(3px);
}

.legal-panel {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(23, 22, 17, 0.28);
}

.legal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}

.legal-copy {
  overflow: auto;
  max-height: min(52vh, 430px);
  padding: 14px 2px 4px;
}

.legal-copy p {
  margin: 0 0 12px;
  color: var(--muted);
}

.legal-copy p:last-child {
  margin-bottom: 0;
}

.legal-actions {
  display: flex;
  justify-content: flex-end;
  margin: 16px 0 0;
  padding: 0;
}

@media (max-width: 860px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .brand-logo {
    width: min(178px, 56vw);
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: space-between;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard,
  .method {
    grid-template-columns: 1fr;
  }

  .dashboard {
    min-height: auto;
  }

  .dashboard {
    display: flex;
    flex-direction: column;
  }

  .dashboard-main,
  .dashboard-side {
    display: contents;
  }

  .vote-panel,
  .ad-slot,
  .today-card,
  .stats-grid,
  .results-panel,
  .chart-heading,
  .chart-wrap,
  .comment-panel,
  .history-table-section {
    width: 100%;
  }

  .ad-slot {
    order: 1;
    min-height: 66px;
    padding: 8px 12px;
    margin-top: -6px;
  }

  .chart-heading {
    order: 2;
    margin-top: 0;
    margin-bottom: 8px;
  }

  .today-card {
    order: 3;
  }

  .mobile-market-strip {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 4px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    text-align: right;
  }

  .mobile-market-strip span,
  .mobile-market-strip small {
    color: rgba(255, 247, 223, 0.7);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-market-strip strong {
    margin: 0;
    color: #fff7df;
    font-size: 24px;
    line-height: 1;
    text-align: right;
  }

  .mobile-market-strip small {
    grid-column: auto;
  }

  .chart-wrap {
    order: 4;
  }

  .comment-panel {
    order: 4;
  }

  .vote-panel {
    order: 5;
  }

  .vote-panel .section-heading.compact {
    align-items: center;
    text-align: center;
  }

  .vote-panel .pill {
    align-self: center;
  }

  .results-panel {
    order: 6;
  }

  .stats-grid {
    order: 7;
  }

  .stats-grid .latest-stat,
  .stats-grid .votes-stat {
    display: none;
  }

  .history-table-section {
    order: 8;
    min-width: 0;
  }

  .table-wrap {
    width: 100%;
    min-width: 0;
  }

  .method {
    order: 9;
    gap: 18px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #price-chart,
  .chart-wrap {
    height: 330px;
    min-height: 330px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .comment-barrage {
    inset: 10px 12px auto 12px;
    height: 90px;
  }

  .barrage-item {
    font-size: 12px;
    max-width: 66%;
    padding: 5px 9px;
  }
}

@media (max-width: 540px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .comment-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .comment-form input {
    min-height: 42px;
    padding: 0 10px;
    font-size: 14px;
  }

  .comment-form .button {
    min-height: 42px;
    width: 108px;
    padding: 0 10px;
  }

  .bar-row {
    grid-template-columns: 58px 1fr 48px;
    gap: 8px;
  }

}

@media (max-width: 360px) {
  .today-card {
    grid-template-columns: 1fr;
  }

  .today-market {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 247, 223, 0.18);
  }

  .mobile-market-strip {
    text-align: left;
  }

  .mobile-market-strip strong {
    text-align: left;
  }
}

