:root {
  --vote-ink: #18283e;
  --vote-muted: #6c7b8f;
  --vote-line: #dce4ed;
  --vote-blue: #2d63b8;
  --vote-red: #c63d4d;
  --vote-teal: #167567;
  --vote-gold: #a76a16;
}

body,
.app-frame { background: #edf2f6; }

.number-vote-page {
  min-height: calc(100vh - 76px);
  padding: 24px 28px 42px;
  color: var(--vote-ink);
  background: #edf2f6;
}

.vote-hero,
.vote-lottery-panel,
.vote-workspace {
  width: min(1480px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.vote-hero {
  min-height: 132px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 26px 30px;
  color: #fff;
  background: #162d4f;
  border-left: 5px solid #e55763;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 46, 77, .13);
}

.vote-hero-copy p,
.vote-panel-heading p,
.vote-selection-card header p,
.vote-ranking-card header p {
  margin: 0 0 5px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.vote-hero-copy p { color: #ff9da7; }
.vote-hero-copy h1 { margin: 0; font-size: 30px; }
.vote-hero-copy span { display: block; max-width: 760px; margin-top: 9px; color: rgba(255,255,255,.7); font-size: 13px; line-height: 1.75; }
.vote-hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(112px, 1fr)); gap: 10px; }
.vote-hero-metrics > div { min-height: 72px; padding: 14px 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13); border-radius: 6px; }
.vote-hero-metrics small, .vote-hero-metrics strong { display: block; }
.vote-hero-metrics small { color: rgba(255,255,255,.56); font-size: 10px; }
.vote-hero-metrics strong { margin-top: 8px; font-size: 16px; font-variant-numeric: tabular-nums; }

.vote-lottery-panel { margin-top: 16px; padding: 17px 18px 0; background: #fff; border: 1px solid var(--vote-line); border-radius: 8px; }
.vote-lottery-tabs { display: grid; grid-template-columns: repeat(6, minmax(112px, 1fr)); gap: 8px; }
.vote-lottery-tabs button { min-height: 39px; padding: 0 10px; color: #5f6f84; font-size: 12px; font-weight: 800; background: #f4f6f9; border: 1px solid #dfe5ec; border-radius: 5px; }
.vote-lottery-tabs button:hover { color: var(--vote-blue); border-color: #adc3e6; }
.vote-lottery-tabs button.active { color: #fff; background: #2c5fa9; border-color: #2c5fa9; box-shadow: 0 6px 15px rgba(44,95,169,.18); }
.vote-round-strip { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 12px 0; border-top: 1px solid #e8edf2; }
.vote-round-strip > div { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.vote-round-strip > div > span { color: #5e6d80; font-size: 12px; font-weight: 800; }
.vote-latest-numbers { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.vote-latest-ball { min-width: 25px; height: 25px; display: grid; place-items: center; padding: 0 4px; color: #fff; background: var(--vote-red); border-radius: 50%; font-size: 9px; font-weight: 900; font-variant-numeric: tabular-nums; }
.vote-latest-ball.back { background: var(--vote-blue); }
.vote-latest-ball.digital { background: #445b78; }
.vote-refresh-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto; padding: 0 14px; color: #fff; background: #33465f; border: 0; border-radius: 5px; font-size: 11px; font-weight: 800; }
.vote-refresh-button:hover { background: #243750; }
.vote-refresh-button svg { width: 16px; height: 16px; }
.vote-refresh-button.loading svg { animation: vote-spin .8s linear infinite; }

.vote-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 326px; align-items: start; gap: 18px; margin-top: 18px; }
.vote-ballot-panel,
.vote-side-column > section { background: #fff; border: 1px solid var(--vote-line); border-radius: 8px; box-shadow: 0 7px 22px rgba(28,43,68,.04); }
.vote-ballot-panel { min-width: 0; min-height: 640px; padding: 22px; }
.vote-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid #e6ebf1; }
.vote-panel-heading p, .vote-selection-card header p, .vote-ranking-card header p { color: #8a96a6; }
.vote-panel-heading h2, .vote-selection-card h2, .vote-ranking-card h2 { margin: 0; font-size: 18px; }
.vote-panel-heading span { display: block; margin-top: 6px; color: var(--vote-muted); font-size: 11px; }
.vote-panel-heading > svg { width: 28px; height: 28px; flex: 0 0 auto; color: var(--vote-red); }
.vote-zone-list { display: grid; }
.vote-zone { padding: 28px 0 12px; border-bottom: 1px solid #e8edf2; }
.vote-zone:last-child { padding-bottom: 4px; border-bottom: 0; }
.vote-zone > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.vote-zone-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.vote-zone-title i { width: 4px; height: 34px; display: block; flex: 0 0 auto; background: var(--vote-red); border-radius: 2px; }
.vote-zone.kind-back .vote-zone-title i { background: var(--vote-blue); }
.vote-zone.kind-position .vote-zone-title i { background: var(--vote-teal); }
.vote-zone-title strong, .vote-zone-title small { display: block; }
.vote-zone-title strong { font-size: 16px; }
.vote-zone-title small { margin-top: 4px; color: #8793a4; font-size: 10px; }
.vote-zone > header > span { padding: 5px 8px; color: #6e7c8f; background: #f3f6f9; border: 1px solid #e0e6ee; border-radius: 4px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.vote-number-grid { display: grid; grid-template-columns: 1fr; column-gap: 28px; }
.vote-zone.options-20 .vote-number-grid, .vote-zone.options-22 .vote-number-grid, .vote-zone.options-33 .vote-number-grid, .vote-zone.options-36 .vote-number-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vote-zone.options-80 .vote-number-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vote-number-option { --vote-strength: 0%; position: relative; min-width: 0; min-height: 74px; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; overflow: hidden; padding: 13px 2px 12px 0; color: #25354a; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #edf1f5; border-radius: 0; cursor: pointer; }
.vote-number-option::before { content: ""; position: absolute; right: 2px; bottom: 7px; left: 0; height: 5px; background: #ecf1f4; border-radius: 999px; opacity: 0; }
.vote-number-option::after { content: ""; position: absolute; bottom: 7px; left: 0; width: var(--vote-strength); height: 5px; background: #10b968; border-radius: 999px; opacity: 0; transition: width .24s ease; }
.vote-number-option.show-result::before, .vote-number-option.show-result::after { opacity: 1; }
.vote-number-option:hover:not(:disabled) { background: #f8fbfd; }
.vote-number-option.selected { background: #fff5f6; }
.vote-zone.kind-back .vote-number-option.selected { background: #f2f7ff; }
.vote-zone.kind-position .vote-number-option.selected { background: #effaf7; }
.vote-number-option:disabled { cursor: default; opacity: 1; }
.vote-option-number { padding-left: 6px; color: #17243a; font-size: 23px; font-weight: 500; font-variant-numeric: tabular-nums; }
.vote-zone.kind-back .vote-option-number { color: var(--vote-blue); }
.vote-zone.kind-position .vote-option-number { color: var(--vote-teal); }
.vote-number-option.selected .vote-option-number { color: var(--vote-red); font-weight: 900; }
.vote-zone.kind-back .vote-number-option.selected .vote-option-number { color: var(--vote-blue); }
.vote-zone.kind-position .vote-number-option.selected .vote-option-number { color: var(--vote-teal); }
.vote-option-detail { min-width: 0; overflow: hidden; color: #9aa5b1; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.vote-number-option.selected .vote-option-detail { color: #ad5a64; }
.vote-zone.kind-back .vote-number-option.selected .vote-option-detail { color: #5a80b5; }
.vote-zone.kind-position .vote-number-option.selected .vote-option-detail { color: #3c8d7d; }
.vote-result-values { min-width: 90px; display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 10px; color: #adb5be; font-variant-numeric: tabular-nums; }
.vote-result-values strong { font-size: 15px; font-weight: 500; }
.vote-result-values small { font-size: 13px; }
.vote-result-values i { width: 26px; height: 26px; display: grid; place-items: center; color: #8090a3; background: #edf2f6; border: 1px solid #d9e1ea; border-radius: 50%; font-size: 16px; font-style: normal; line-height: 1; }
.vote-number-option.selected .vote-result-values i { color: #fff; background: var(--vote-red); border-color: var(--vote-red); }
.vote-zone.kind-back .vote-number-option.selected .vote-result-values i { background: var(--vote-blue); border-color: var(--vote-blue); }
.vote-zone.kind-position .vote-number-option.selected .vote-result-values i { background: var(--vote-teal); border-color: var(--vote-teal); }
.vote-number-option.show-result .vote-option-detail { color: #b0b8c1; }

.vote-side-column { min-width: 0; display: grid; gap: 14px; }
.vote-side-column > section { padding: 18px; }
.vote-account-card header { display: flex; align-items: center; gap: 12px; }
.vote-account-card header > svg { width: 34px; height: 34px; padding: 7px; color: #62748a; background: #eef2f6; border-radius: 50%; }
.vote-account-card.authenticated header > svg { color: #fff; background: var(--vote-teal); }
.vote-account-card small, .vote-account-card strong { display: block; }
.vote-account-card small { color: #8793a4; font-size: 9px; }
.vote-account-card strong { margin-top: 3px; font-size: 13px; }
.vote-account-card p { margin: 12px 0 0; color: var(--vote-muted); font-size: 11px; line-height: 1.7; }
.vote-selection-card { position: sticky; top: 94px; }
.vote-selection-card > header, .vote-ranking-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #e7ecf1; }
.vote-selection-card > header > strong { color: var(--vote-red); font-size: 13px; font-variant-numeric: tabular-nums; }
.vote-selection-list { min-height: 94px; display: grid; align-content: start; gap: 9px; padding: 14px 0; }
.vote-selection-list > span { align-self: center; color: #8a95a5; font-size: 11px; text-align: center; }
.vote-selection-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: start; gap: 9px; }
.vote-selection-row > strong { color: #718096; font-size: 10px; line-height: 23px; }
.vote-selection-balls { display: flex; flex-wrap: wrap; gap: 4px; }
.vote-selection-chip { min-width: 23px; height: 23px; display: grid; place-items: center; padding: 0 4px; color: #fff; background: var(--vote-red); border-radius: 50%; font-size: 9px; font-weight: 900; }
.vote-selection-chip.back { background: var(--vote-blue); }
.vote-selection-chip.position { background: var(--vote-teal); }
.vote-selection-card > button { width: 100%; min-height: 43px; color: #fff; background: #c83d4c; border: 0; border-radius: 5px; font-size: 12px; font-weight: 900; }
.vote-selection-card > button:hover:not(:disabled) { background: #ad2e3d; }
.vote-selection-card > button:disabled { color: #8a95a4; background: #e7ebf0; cursor: default; }
.vote-selection-card > p { margin: 10px 0 0; color: #8793a3; font-size: 9px; line-height: 1.6; text-align: center; }
.vote-ranking-card > header > svg { width: 23px; height: 23px; color: var(--vote-gold); }
.vote-ranking-list { display: grid; margin-top: 6px; }
.vote-ranking-list > span { padding: 24px 0; color: #8a95a5; font-size: 11px; text-align: center; }
.vote-ranking-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 43px; border-bottom: 1px solid #edf0f4; }
.vote-ranking-item:last-child { border-bottom: 0; }
.vote-ranking-item > b { width: 22px; height: 22px; display: grid; place-items: center; color: #fff; background: #66788f; border-radius: 50%; font-size: 9px; }
.vote-ranking-item:nth-child(1) > b { background: #bf3a48; }
.vote-ranking-item:nth-child(2) > b { background: #b47722; }
.vote-ranking-item:nth-child(3) > b { background: #4f759c; }
.vote-ranking-item strong, .vote-ranking-item small { display: block; }
.vote-ranking-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.vote-ranking-item small { margin-top: 2px; color: #8b96a6; font-size: 8px; }
.vote-ranking-item em { color: var(--vote-red); font-size: 11px; font-style: normal; font-weight: 900; font-variant-numeric: tabular-nums; }
.vote-reference-note { background: #fffaf0 !important; border-color: #e8d8ba !important; }
.vote-reference-note strong { color: #77581f; font-size: 11px; }
.vote-reference-note p { margin: 7px 0 0; color: #796c54; font-size: 10px; line-height: 1.7; }
.vote-loading, .vote-error { min-height: 420px; display: grid; place-items: center; color: #7f8b9c; font-size: 13px; }
.vote-error { color: #b23845; }

.vote-login-dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 24px 70px rgba(15,25,42,.28); }
.vote-login-dialog::backdrop { background: rgba(16,25,40,.56); }
.vote-login-dialog form { position: relative; display: grid; justify-items: center; padding: 34px 30px 30px; text-align: center; }
.vote-login-dialog form > svg { width: 38px; height: 38px; color: var(--vote-red); }
.vote-login-dialog h2 { margin: 15px 0 8px; font-size: 21px; }
.vote-login-dialog p { margin: 0; color: var(--vote-muted); font-size: 13px; line-height: 1.7; }
.vote-login-dialog a { min-height: 42px; display: inline-flex; align-items: center; margin-top: 22px; padding: 0 22px; color: #fff; background: var(--vote-red); border-radius: 5px; font-weight: 800; }
.vote-dialog-close { position: absolute; top: 9px; right: 11px; width: 32px; height: 32px; color: #7d8796; background: transparent; border: 0; font-size: 24px; }
.vote-toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 380px; padding: 12px 17px; color: #fff; background: #223149; border-radius: 5px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; }
.vote-toast.show { opacity: 1; transform: translateY(0); }
.vote-toast.error { background: #b93440; }

@keyframes vote-spin { to { transform: rotate(360deg); } }

@media (max-width: 1240px) {
  .vote-hero { grid-template-columns: 1fr; }
  .vote-lottery-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vote-workspace { grid-template-columns: minmax(0, 1fr) 292px; }
  .vote-zone.options-80 .vote-number-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .vote-workspace { grid-template-columns: 1fr; }
  .vote-side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vote-selection-card { position: static; }
  .vote-reference-note { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .number-vote-page { padding: 14px 12px 30px; }
  .vote-hero { min-height: 0; gap: 15px; padding: 19px 16px; }
  .vote-hero-copy h1 { font-size: 25px; }
  .vote-hero-copy span { margin-top: 7px; font-size: 12px; line-height: 1.6; }
  .vote-hero-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vote-hero-metrics { gap: 6px; }
  .vote-hero-metrics > div { min-width: 0; min-height: 62px; padding: 10px 8px; }
  .vote-hero-metrics small { font-size: 8px; }
  .vote-hero-metrics strong { margin-top: 7px; overflow-wrap: anywhere; font-size: 12px; }
  .vote-lottery-panel { padding: 13px 12px 0; }
  .vote-lottery-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .vote-lottery-tabs button { min-height: 38px; padding: 0 5px; font-size: 11px; }
  .vote-round-strip { align-items: stretch; flex-direction: column; }
  .vote-round-strip > div { display: grid; }
  .vote-refresh-button { width: 100%; }
  .vote-ballot-panel { min-height: 0; padding: 17px 13px; }
  .vote-panel-heading { align-items: flex-start; }
  .vote-panel-heading span { max-width: 250px; line-height: 1.6; }
  .vote-zone { padding: 18px 0; }
  .vote-number-grid,
  .vote-zone.options-20 .vote-number-grid,
  .vote-zone.options-22 .vote-number-grid,
  .vote-zone.options-33 .vote-number-grid,
  .vote-zone.options-36 .vote-number-grid,
  .vote-zone.options-80 .vote-number-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .vote-number-option { min-height: 78px; grid-template-columns: 1fr; justify-items: center; align-content: center; gap: 3px; padding: 8px 3px; text-align: center; background: #f8fafc; border: 1px solid #e2e8ef; border-radius: 6px; }
  .vote-number-option::before, .vote-number-option::after { right: 5px; bottom: 5px; left: 5px; height: 3px; }
  .vote-option-number { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; color: #fff; background: var(--vote-red); border-radius: 50%; font-size: 13px; font-weight: 900; }
  .vote-zone.kind-back .vote-option-number { color: #fff; background: var(--vote-blue); }
  .vote-zone.kind-position .vote-option-number { color: #fff; background: var(--vote-teal); }
  .vote-number-option.selected .vote-option-number, .vote-zone.kind-back .vote-number-option.selected .vote-option-number, .vote-zone.kind-position .vote-number-option.selected .vote-option-number { color: #fff; box-shadow: 0 0 0 3px rgba(198,61,77,.15); }
  .vote-option-detail { max-width: 100%; font-size: 8px; }
  .vote-result-values { min-width: 0; max-width: 100%; min-height: 20px; justify-content: center; gap: 3px; }
  .vote-result-values strong { font-size: 9px; }
  .vote-result-values small { font-size: 8px; }
  .vote-result-values i { width: 22px; height: 22px; font-size: 14px; }
  .vote-side-column { grid-template-columns: 1fr; }
  .vote-reference-note { grid-column: auto; }
  .vote-toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

@media (max-width: 410px) {
  .vote-hero-metrics > div { min-height: 58px; padding: 9px 6px; }
  .vote-hero-metrics strong { font-size: 11px; }
  .vote-lottery-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vote-zone > header { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .vote-number-option, .vote-toast { transition: none; }
}
