:root {
  --ink: #f4f7f2; --muted: #9daaa0; --bg: #090d0a; --panel: #151b17; --panel-soft: #1b231d;
  --line: #2a352d; --green: #69d34f; --green-dark: #347d2b; --gold: #f2c14e; --red: #ef6a60;
  color-scheme: dark; font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sky { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: radial-gradient(circle at 15% 5%, #244629 0, transparent 32%), linear-gradient(145deg, #111a13 0%, #080b09 62%); }
.sky::before { content: ""; position: absolute; inset: 0; opacity: .28; background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(to bottom, #000, transparent 68%); }
.sky::after { content: ""; position: absolute; width: 420px; height: 420px; top: -210px; right: -80px; border-radius: 50%; background: #77dc5c18; filter: blur(4px); box-shadow: 0 0 120px #68cb4c1c; }

/* Login */
.login-shell { min-height: 100svh; width: min(1160px, calc(100% - 48px)); margin: auto; display: grid; grid-template-columns: 1.05fr .8fr; align-items: center; gap: clamp(44px, 8vw, 110px); padding: 56px 0; }
.login-hero { max-width: 610px; }
.brand-block { display: inline-flex; align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: clamp(42px, 7vh, 76px); }
.brand-logo { width: clamp(150px, 18vw, 190px); height: auto; display: block; object-fit: contain; border: 1px solid #405044; border-radius: 12px; box-shadow: 8px 8px #020302, 0 18px 45px #0007; }
.brand-block small { display: block; color: #b7c2b8; font-size: 10px; font-weight: 700; letter-spacing: 5px; }
.hero-kicker { display: flex; align-items: center; gap: 9px; margin: 0 0 19px; color: #c2cec3; font-size: 11px !important; font-weight: 800; letter-spacing: 2.5px; }
.hero-kicker span { width: 8px; height: 8px; background: var(--green); box-shadow: 0 0 13px var(--green); }
.login-hero > h1 { margin: 0; max-width: 600px; font-size: clamp(50px, 7vw, 82px); line-height: .96; letter-spacing: -5px; }
.login-hero > h1 em { color: var(--green); font-style: normal; }
.login-hero > p:not(.hero-kicker) { max-width: 520px; margin: 25px 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.hero-features { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-features span { padding: 8px 12px; color: #c7d0c8; background: #151d17bd; border: 1px solid var(--line); font-size: 12px; }
.pixel-panel { background: linear-gradient(145deg, #1b241d, #111713); border: 1px solid #435247; box-shadow: inset 0 1px #ffffff0d, 0 30px 80px #0008, 8px 8px #030504; }
.login-card { position: relative; width: 100%; padding: clamp(28px, 4vw, 43px); }
.eyebrow { margin: 0 0 11px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 2.5px; }
.login-card h2 { margin: 0 0 12px; font-size: clamp(25px, 3vw, 32px); letter-spacing: -.8px; }
.muted { color: var(--muted); line-height: 1.6; }
.login-card > .muted { margin-bottom: 0; font-size: 14px; }
.login-card form { display: grid; gap: 18px; margin-top: 27px; }
label { display: grid; gap: 8px; color: #d6ded6; font-size: 12px; font-weight: 700; }
.form-hint { color: #7f8d82; font-size: 9px; font-weight: 500; line-height: 1.45; }
input, select, textarea { width: 100%; padding: 13px 14px; color: var(--ink); background: #090e0b; border: 1px solid #3b493e; border-radius: 2px; outline: 0; box-shadow: inset 3px 3px #050705; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: inset 3px 3px #050705, 0 0 0 3px #68d24f18; }
#register-code { font-size: 23px; font-weight: 800; letter-spacing: 11px; text-align: center; }
.auth-step > .muted strong { color: var(--green); }
.auth-step .mc-button.ghost { margin-top: -6px; }
kbd { padding: 3px 7px; color: #eef8eb; background: #090d0a; border: 1px solid #445147; border-radius: 2px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.torch { position: absolute; top: -13px; right: 28px; width: 7px; height: 24px; background: #6b432a; transform: rotate(8deg); box-shadow: 0 -7px 0 2px #edac42, 0 -12px 0 #fff194, 0 -15px 16px #ffb331; }
.form-error { min-height: 20px; margin: 13px 0 5px; color: #ff857b; font-size: 12px; }
.login-foot { padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; }
.command-copy { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 13px; cursor: pointer; color: #e8f4e6; background: #0c120e; border: 1px solid #3b493e; }
.command-copy span { color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; background: var(--green); box-shadow: 0 0 10px #72db58; }

/* Buttons */
.mc-button { position: relative; min-height: 42px; padding: 10px 16px; cursor: pointer; color: #fff; background: #4d5b50; border: 1px solid #819084; border-right-color: #253028; border-bottom-color: #253028; border-radius: 2px; box-shadow: 3px 3px #030504; font-size: 12px; font-weight: 800; letter-spacing: .2px; transition: filter .15s, transform .15s; }
.mc-button:hover { filter: brightness(1.15); }
.mc-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px #030504; }
.mc-button.primary { background: linear-gradient(#4c9c3b, #34752b); border-top-color: #87d772; border-left-color: #87d772; }
.mc-button.danger { background: #93433d; }
.mc-button.gold { background: #967128; }
.mc-button.ghost { margin-top: 14px; background: transparent; border-color: #4a584d; box-shadow: none; }
.mc-button.small { min-height: 35px; padding: 7px 12px; font-size: 11px; }
.mc-button:disabled { cursor: not-allowed; opacity: .42; filter: grayscale(.3); }
.mc-button.is-loading::after { content: ""; position: absolute; top: 50%; right: 18px; width: 12px; height: 12px; margin-top: -7px; border: 2px solid #ffffff55; border-top-color: #fff; border-radius: 50%; animation: smooth-spin .7s linear infinite; }

/* Portal navigation */
.portal { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; gap: 26px; padding: 0 max(24px, calc((100vw - 1320px) / 2)); background: #0d130ff2; border-bottom: 1px solid #2e3a31; box-shadow: 0 9px 30px #0007; backdrop-filter: blur(14px); }
.mini-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.mini-brand img { width: 48px; height: 48px; display: block; object-fit: cover; border: 1px solid #536858; border-radius: 8px; box-shadow: 3px 3px #030504; }
.topbar nav { align-self: stretch; flex: 1; display: flex; }
.topbar nav a { display: grid; place-items: center; padding: 0 13px; margin-bottom: -1px; color: #9daaa0; border-bottom: 2px solid transparent; text-decoration: none; font-size: 11px; font-weight: 700; white-space: nowrap; transition: color .2s, background .2s; }
.topbar nav a:hover, .topbar nav a.active { color: #fff; background: #ffffff05; border-bottom-color: var(--green); }
.player-menu { display: flex; align-items: center; gap: 10px; }
.player-menu img { width: 40px; height: 40px; background: #263228; border: 1px solid #5c755f; }
.player-menu small { display: block; color: #7d8a80; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.player-menu strong { font-size: 12px; }
.player-menu button, .nav-toggle { padding: 5px; cursor: pointer; color: #829086; background: transparent; border: 0; font-size: 23px; }
.nav-toggle { display: none; }

/* Content */
#content { width: min(1240px, calc(100% - 40px)); min-height: 68vh; margin: 42px auto 90px; outline: 0; }
.page-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 26px; }
.page-head p { margin: 0; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 2.5px; }
.page-head h1 { margin: 5px 0 0; font-size: clamp(29px, 4vw, 43px); line-height: 1; letter-spacing: -1.8px; }
.sync { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(4, 1fr); }
.grid.two { grid-template-columns: 1.35fr .65fr; }
.card { padding: 21px; background: linear-gradient(145deg, var(--panel-soft), var(--panel)); border: 1px solid var(--line); border-radius: 3px; box-shadow: inset 0 1px #ffffff08, 5px 5px #050706; }
.card h2, .card h3 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.3px; }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -28px; bottom: -50px; width: 100px; height: 100px; border: 18px solid #ffffff04; transform: rotate(45deg); }
.stat small { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.2px; }
.stat strong { display: block; margin: 10px 0 5px; font-size: clamp(21px, 2vw, 26px); }
.green { color: #7cdd62; } .gold-text { color: var(--gold); } .red-text { color: #ff7d73; } .blue-text { color: #65c5e8; }
.account-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.account-tab { padding: 10px 13px; cursor: pointer; color: #aebaaa; background: #121813; border: 1px solid #3a473d; border-radius: 2px; font-size: 12px; }
.account-tab.active { color: #fff; background: #2f6528; border-color: #70b85c; }
.badge { display: inline-block; padding: 4px 7px; color: #d5ddd6; background: #303a32; border: 1px solid #4a584d; border-radius: 2px; font-size: 9px; font-weight: 800; letter-spacing: .5px; }
.badge.live { color: #eaffea; background: #266b2c; border-color: #58a85c; }
.list { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px; background: #0e1410; border-left: 2px solid #465549; }
.list-row p { margin: 3px 0; color: var(--muted); font-size: 11px; }
.statement-row { align-items: flex-start; }
.statement-row small { flex: 0 0 auto; padding: 3px 6px; color: #77837a; background: #19211b; border-radius: 2px; font-size: 9px; }
.transaction { line-height: 1.55; overflow-wrap: anywhere; }
.transaction.credit { color: #82df69; }
.transaction.debit { color: #ff8b82; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.inline-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inline-form .wide { grid-column: 1 / -1; }
.empty { padding: 42px 20px; color: var(--muted); border: 1px dashed #3b493e; text-align: center; }
.empty.compact { padding: 25px 16px; }
.empty .pixel-icon { display: block; margin-bottom: 10px; font-size: 38px; }
.candidate { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 15px; padding: 12px; background: #0e1410; border: 1px solid #253028; border-radius: 2px; }
.candidate .number { width: 45px; height: 45px; display: grid; place-items: center; color: var(--gold); background: #222d24; border: 1px solid #526956; font-weight: 900; }
.candidate p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.leader-card { border-top: 3px solid #56b740; }
.leader-rank { float: right; color: var(--gold); font-size: 27px; font-weight: 800; }
.tag-chip { color: var(--green); font-weight: 800; letter-spacing: 1.5px; }

/* Elections */
.election-current { padding: 0; overflow: hidden; }
.election-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px; background: linear-gradient(110deg, #1e2c20, #151b17); border-bottom: 1px solid var(--line); }
.election-summary h2 { margin: 11px 0 5px; font-size: 25px; }
.election-summary p { margin: 0; color: var(--muted); font-size: 12px; }
.vote-counter { min-width: 145px; padding-left: 25px; border-left: 1px solid var(--line); text-align: right; }
.vote-counter strong { display: block; color: var(--green); font-size: 29px; }
.vote-counter strong small { color: #c7d1c9; font-size: 16px; }
.vote-counter span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 1.2px; }
.candidate-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 20px; }
.vote-complete { display: flex; align-items: center; gap: 16px; margin: 20px; padding: 20px; background: #101a13; border: 1px solid #31533a; }
.vote-complete .pixel-icon { flex: 0 0 auto; color: var(--green); font-size: 30px; }
.vote-complete h3 { margin: 0 0 6px; color: var(--green); }
.vote-complete p { margin: 0; color: var(--muted); font-size: 11px; }
.election-current > .mc-button { margin: 0 20px 20px; }
.live-counting { padding: 20px; }
.counting-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin-bottom: 18px; padding: 16px; background: #101a13; border: 1px solid #31533a; }
.counting-progress > div:first-child strong, .counting-progress > div:first-child span { display: block; }
.counting-progress > div:first-child strong { color: var(--green); font-size: 25px; }
.counting-progress > div:first-child span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.counting-progress-bar { width: 100%; height: 12px; overflow: hidden; appearance: none; background: #253028; border: 1px solid #3c4b40; }
.counting-progress-bar::-webkit-progress-bar { background: #253028; }
.counting-progress-bar::-webkit-progress-value { background: linear-gradient(90deg,#3c982f,var(--green)); transition: width .45s ease; }
.counting-progress-bar::-moz-progress-bar { background: linear-gradient(90deg,#3c982f,var(--green)); transition: width .45s ease; }
.counting-partials { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.counting-candidate { display: grid; grid-template-columns: 28px 82px 1fr auto; align-items: center; gap: 12px; padding: 13px; background: #0b110d; border: 1px solid #29352c; }
.counting-position { color: var(--gold); font-size: 18px; font-weight: 900; text-align: center; }
.counting-avatar { position: relative; width: 80px; height: 80px; display: grid; place-items: center; border-radius: 50%; }
.counting-avatar svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.counting-avatar circle { fill: none; stroke-width: 4; }
.counting-ring-track { stroke: #263129; }
.counting-ring-value { stroke: var(--green); stroke-linecap: round; transition: stroke-dasharray .45s ease; }
.counting-avatar img { position: relative; z-index: 1; width: 62px; height: 62px; object-fit: cover; background: #131b15; border: 2px solid #0b110d; border-radius: 50%; }
.counting-candidate-info strong, .counting-candidate-info span, .counting-candidate-info small { display: block; }
.counting-candidate-info span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.counting-candidate-info small { margin-top: 7px; color: #d3ddd5; }
.counting-percentage { color: var(--green); font-size: 20px; }
.live-counting footer { display: flex; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.election-application { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 20px 20px 0; padding: 18px; background: #152519; border: 1px solid #31533a; border-left: 3px solid var(--green); }
.election-application h3 { margin: 0 0 5px; font-size: 16px; }
.election-application p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.calendar-section { margin-top: 33px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 16px; }
.section-title h2 { margin: 3px 0 0; font-size: 23px; }
.section-title > p { max-width: 400px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.election-calendar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.calendar-card { position: relative; display: grid; grid-template-columns: 58px 72px 1fr; gap: 16px; padding: 22px; overflow: hidden; background: linear-gradient(145deg, #1a221c, #111713); border: 1px solid #354239; border-radius: 3px; box-shadow: 5px 5px #050706; }
.calendar-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--green); }
.calendar-card.senator::before { background: var(--gold); }
.calendar-icon { width: 52px; height: 52px; display: grid; place-items: center; color: #142015; background: var(--green); border: 4px solid #88e270; border-right-color: #33762b; border-bottom-color: #33762b; font-size: 23px; }
.senator .calendar-icon { color: #33270d; background: var(--gold); border-color: #ffe08a; border-right-color: #8b6720; border-bottom-color: #8b6720; }
.calendar-date { align-self: start; padding-right: 15px; border-right: 1px solid var(--line); text-align: center; }
.calendar-date strong { display: block; font-size: 31px; line-height: 1; }
.calendar-date span { display: block; margin-top: 6px; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.senator .calendar-date span { color: var(--gold); }
.calendar-info h3 { margin: 10px 0 4px; font-size: 17px; }
.calendar-info > p { margin: 0; color: var(--muted); font-size: 11px; }
.calendar-info dl { display: grid; gap: 8px; margin: 17px 0 0; }
.calendar-info dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid #29332b; }
.calendar-info dt { color: #78867b; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.calendar-info dd { margin: 0; font-size: 10px; font-weight: 700; text-align: right; text-transform: capitalize; }
.invite-card { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 18px; border-left: 3px solid var(--gold); }
.invite-card h2 { margin: 4px 0 7px; }
.invite-card .actions { flex: 0 0 auto; margin: 0; }
.clan-member .member-actions { justify-content: flex-end; margin-top: 0; }
.ranking-card { margin-top: 18px; }
.ranking-card .section-title { margin-bottom: 18px; }
.score-ranking { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.score-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 12px; background: #0e1410; border: 1px solid #253028; }
.score-row > div small, .score-row > strong small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 600; text-transform: uppercase; }
.score-row > strong { color: var(--green); text-align: right; }
.rank-position { width: 34px; height: 34px; display: grid; place-items: center; color: #aeb9b0; background: #202922; font-size: 11px; font-weight: 900; }
.rank-position.podium { color: #312608; background: var(--gold); }
.search-bar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 18px; padding: 17px 19px; background: #111813; border: 1px solid var(--line); }
.search-bar > label { display: block; font-size: 13px; }
.search-bar > div { width: min(360px, 100%); display: flex; align-items: center; background: #090e0b; border: 1px solid #3b493e; }
.search-bar > div:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px #68d24f18; }
.search-bar > div span { padding-left: 13px; color: var(--green); font-weight: 900; }
.search-bar input { border: 0; box-shadow: none; }
.search-bar input:focus { border: 0; box-shadow: none; }
.searchable-list { margin-top: 0; }
.project-author { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.project-author span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.project-author strong { font-size: 12px; }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 17px 19px; background: linear-gradient(110deg, #18251b, #111813); border: 1px solid #304236; border-left: 3px solid var(--green); }
.page-actions strong, .page-actions span { display: block; }
.page-actions span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.receipt-grid { display: grid; gap: 9px; }
.receipt { display: grid; grid-template-columns: 1.3fr 1fr auto; align-items: center; gap: 18px; padding: 15px; background: #0c120e; border: 1px solid #29352c; border-left: 3px solid var(--green); }
.receipt div > strong, .receipt div > small { display: block; margin-top: 6px; }
.receipt small { color: var(--muted); font-size: 9px; }
.history-card { padding: 0; overflow: hidden; }
.history-card-summary { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; cursor: pointer; color: inherit; background: linear-gradient(110deg, #1b251e, #131915); border: 0; text-align: left; transition: background .2s; }
.history-card-summary:hover { background: linear-gradient(110deg, #223027, #171f19); }
.history-card-summary h2 { margin: 10px 0 5px; font-size: 20px; }
.history-card-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.history-card-summary > div:last-child { flex: 0 0 auto; text-align: right; }
.history-card-summary > div:last-child strong, .history-card-summary > div:last-child span { display: block; }
.history-card-summary > div:last-child strong { font-size: 11px; text-transform: uppercase; }
.history-card-summary > div:last-child span { margin-top: 8px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.history-details { padding: 0 20px 20px; border-top: 1px solid var(--line); }
.election-history-section.embedded { margin-top: 38px; padding-top: 28px; border-top: 1px solid var(--line); }
.history-round-tabs { display: flex; gap: 7px; margin-top: 14px; border-bottom: 1px solid #29352c; }
.history-round-tab { padding: 10px 15px; cursor: pointer; color: var(--muted); background: #0a0f0c; border: 1px solid #29352c; border-bottom: 0; font: inherit; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.history-round-tab.active { color: var(--green); background: #142019; border-color: #3e6547; }
.history-round { padding: 15px; background: #0b110d; border: 1px solid #29352c; border-top: 0; }
.history-round > small { display: block; margin-top: 11px; color: var(--muted); }
.history-march { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 18px; padding: 16px; background: #101a13; border: 1px solid #31533a; }
.history-march > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.history-march > div:first-child span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.history-march > div:first-child strong { color: var(--green); font-size: 24px; }
.history-march > div:nth-child(2) { height: 12px; overflow: hidden; background: #253028; border: 1px solid #3c4b40; }
.history-march > div:nth-child(2) i { width: 100%; height: 100%; display: block; background: linear-gradient(90deg, #3c982f, var(--green)); }
.history-march small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.history-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.history-metrics > div { padding: 12px; background: #101712; border: 1px solid #29352c; }
.history-metrics span, .history-metrics strong, .history-metrics small { display: block; }
.history-metrics span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.history-metrics strong { margin: 7px 0 3px; font-size: 19px; }
.history-metrics small { color: var(--green); font-size: 9px; }
.history-chart { display: grid; gap: 8px; }
.history-chart-row { display: grid; grid-template-columns: 30px 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; background: #0e1410; border: 1px solid #29352c; }
.history-chart-position { color: var(--gold); font-size: 16px; font-weight: 900; text-align: center; }
.history-chart-row > img { width: 44px; height: 44px; object-fit: cover; background: #151d17; border: 2px solid #536858; border-radius: 50%; image-rendering: pixelated; }
.history-chart-row > div > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.history-chart-row > div > div:first-child span { color: var(--muted); font-size: 10px; }
.history-chart-row > div > small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.history-vote-bar { width: 100%; height: 9px; display: block; margin-top: 8px; overflow: hidden; appearance: none; background: #253028; border: 1px solid #3c4b40; }
.history-vote-bar::-webkit-progress-bar { background: #253028; }
.history-vote-bar::-webkit-progress-value { background: linear-gradient(90deg, #347d2b, var(--green)); }
.history-vote-bar::-moz-progress-bar { background: linear-gradient(90deg, #347d2b, var(--green)); }
.history-candidate-result { display: flex; align-items: end; flex-direction: column; gap: 6px; }
.result-seal { padding: 4px 7px; color: #09100a; background: var(--green); border: 1px solid #8be276; font-size: 8px; font-weight: 900; letter-spacing: .7px; }
.result-seal.reeleito { color: #061315; background: #22d3ee; border-color: #8feaf7; }
.result-seal.second-round { color: #241b04; background: var(--gold); border-color: #ffe292; }
.budget-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.budget-item { padding: 14px; background: #0d130f; border: 1px solid #29352c; }
.budget-item > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; text-transform: capitalize; }
.budget-item span { color: var(--muted); }
.budget-bar { height: 7px; margin-top: 12px; overflow: hidden; background: #222d25; }
.budget-bar i { display: block; height: 100%; background: var(--green); }
.president-timeline { position: relative; display: grid; gap: 12px; padding-left: 28px; }
.president-timeline::before { content: ""; position: absolute; left: 10px; top: 25px; bottom: 25px; width: 2px; background: #354439; }
.president-entry { position: relative; display: grid; grid-template-columns: 42px 64px 1fr; align-items: center; gap: 18px; }
.president-entry::before { content: ""; position: absolute; left: -25px; width: 10px; height: 10px; background: var(--green); border: 4px solid var(--bg); }
.president-entry img { image-rendering: pixelated; border: 1px solid #536b58; }
.president-entry h2 { margin: 8px 0 5px; }
.president-entry p { margin: 0 0 6px; color: var(--muted); font-size: 10px; }
.president-order { color: var(--gold); font-size: 19px; font-weight: 900; }
.newspaper-cover { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 28px; background: linear-gradient(120deg,#ede4cc,#cdbf9e); color: #182019; border-color: #f7eac6; }
.newspaper-cover h2 { font-family: Georgia,serif; font-size: 31px; }
.newspaper-cover p:not(.eyebrow) { margin: 0; color: #4f5a50; }
.newspaper-grid { margin-top: 24px; }
.news-item small { display: block; margin-top: 12px; color: var(--muted); }
.news-ad { border-left: 3px solid var(--gold); }
.news-ad p { margin-bottom: 0; color: var(--muted); font-size: 10px; }

/* Elitegram */
.elitegram-toggle { position: fixed; right: 24px; bottom: 22px; z-index: 42; width: 58px; height: 58px; cursor: pointer; color: #10200f; background: var(--green); border: 3px solid #9af184; border-right-color: #34792c; border-bottom-color: #34792c; box-shadow: 5px 5px #020402,0 0 28px #72db5844; font-size: 24px; }
.elitegram-toggle span { position: absolute; top: -9px; right: -8px; min-width: 23px; height: 23px; display: grid; place-items: center; padding: 0 5px; color: #fff; background: #c74d47; border: 2px solid #190a09; font-size: 9px; font-weight: 900; }
.elitegram-panel { position: fixed; right: 24px; bottom: 92px; z-index: 41; width: min(820px,calc(100vw - 48px)); height: min(640px,calc(100vh - 125px)); overflow: hidden; background: #0d130f; border: 1px solid #47564a; box-shadow: 10px 10px #020302,0 25px 80px #000b; }
.elitegram-head { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); }
.elitegram-head > div { display: flex; align-items: center; gap: 11px; }
.elitegram-head strong,.elitegram-head small { display: block; }
.elitegram-head small { margin-top: 3px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.elitegram-head button { color: #fff; background: none; border: 0; font-size: 25px; cursor: pointer; }
.elitegram-logo,.group-avatar { width: 38px; height: 38px; display: grid; place-items: center; color: #132011; background: var(--green); border: 2px solid #91e77d; font-weight: 900; }
.elitegram-body { height: calc(100% - 66px); display: grid; grid-template-columns: 270px 1fr; }
.elitegram-body > aside { overflow: auto; border-right: 1px solid var(--line); }
.elitegram-tools { display: flex; gap: 6px; padding: 10px; }
.conversation-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px; cursor: pointer; color: #eaf1eb; background: transparent; border: 0; border-bottom: 1px solid #202a23; text-align: left; }
.conversation-item:hover,.conversation-item.active { background: #18211a; }
.conversation-item img { image-rendering: pixelated; }
.conversation-item div { min-width: 0; flex: 1; }
.conversation-item strong,.conversation-item small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-item strong { font-size: 11px; }.conversation-item small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.conversation-item > b { min-width: 19px; height: 19px; display: grid; place-items: center; color: #142012; background: var(--green); font-size: 8px; }
.presence { width: 7px; height: 7px; display: inline-block; margin-right: 5px; background: #505b52; }
.presence.online { background: var(--green); box-shadow: 0 0 8px var(--green); }
#chat-view { min-width: 0; height: 100%; }
.chat-empty { height: 100%; display: grid; place-content: center; gap: 8px; color: var(--muted); text-align: center; }
.chat-empty.compact { height: auto; padding: 35px 10px; font-size: 10px; }.chat-empty > span { color: var(--green); font-size: 34px; }.chat-empty strong { color: #fff; }
.chat-room { height: 100%; display: flex; flex-direction: column; }
.chat-room > header { min-height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-room > header strong,.chat-room > header small { display: block; }.chat-room > header small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.chat-messages { flex: 1; overflow: auto; padding: 15px; }
.chat-message { display: flex; align-items: end; gap: 8px; margin: 11px 0; }.chat-message.mine { flex-direction: row-reverse; }
.chat-message img { image-rendering: pixelated; }
.chat-message > div { max-width: 76%; padding: 9px 11px; background: #1a241c; border: 1px solid #2c3930; }
.chat-message.mine > div { background: #275d2c; border-color: #438948; }
.chat-message small { color: #91a094; font-size: 7px; }.chat-message p { margin: 4px 0 0; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
#message-form { display: flex; gap: 8px; padding: 11px; border-top: 1px solid var(--line); }
#message-form input { flex: 1; }

/* Feedback and overlays */
.loading { display: grid; place-items: center; gap: 15px; padding-top: 20vh; color: var(--muted); }
.loading i { width: 44px; height: 44px; border: 6px solid #273328; border-top-color: var(--green); animation: smooth-spin .8s linear infinite; }
@keyframes smooth-spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 99; max-width: 380px; padding: 14px 18px; color: #eef5ed; background: #223026; border: 1px solid #6b8a70; border-radius: 2px; box-shadow: 5px 5px #050705; transform: translateY(150%); transition: transform .25s; }
.toast.show { transform: none; } .toast.error { border-color: #d65d53; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: #000c; backdrop-filter: blur(5px); }
.modal { width: min(520px, 100%); max-height: 90vh; padding: 25px; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head button { cursor: pointer; color: #fff; background: none; border: 0; font-size: 24px; }
footer { padding: 26px; color: #68766b; border-top: 1px solid #202a23; text-align: center; font-size: 9px; letter-spacing: 1px; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 11px; }
.site-footer img { width: 44px; height: 44px; object-fit: cover; border: 1px solid #39473c; border-radius: 7px; }
.site-footer span { color: #819085; }

@media (max-width: 1350px) {
  .topbar nav { position: absolute; top: 72px; left: 0; right: 0; display: none; height: auto; max-height: calc(100vh - 72px); overflow: auto; padding: 8px; background: #0d130f; border-bottom: 1px solid #415442; box-shadow: 0 15px 30px #0009; flex-direction: column; }
  .topbar nav.open { display: flex; }
  .topbar nav a { padding: 14px; }
  .nav-toggle { display: block; }
}
@media (max-width: 1050px) {
  .login-shell { grid-template-columns: .9fr 1fr; gap: 45px; }
  .login-hero > h1 { font-size: 58px; }
  .grid.cards { grid-template-columns: repeat(2, 1fr); }
  .candidate-list { grid-template-columns: 1fr; }
  .budget-grid { grid-template-columns: 1fr; }
  .score-ranking { grid-template-columns: 1fr; }
  .calendar-card { grid-template-columns: 50px 62px 1fr; padding: 18px; gap: 12px; }
  .calendar-icon { width: 46px; height: 46px; }
}
@media (max-width: 760px) {
  .login-shell { width: min(100% - 30px, 520px); grid-template-columns: 1fr; gap: 28px; padding: 28px 0; }
  .login-hero { text-align: center; }
  .brand-block { align-items: center; margin-bottom: 35px; }
  .login-hero > h1 { font-size: clamp(43px, 14vw, 62px); letter-spacing: -3px; }
  .login-hero > p:not(.hero-kicker), .hero-features, .hero-kicker { display: none; }
  .login-card { padding: 28px 22px; }
  .topbar { gap: 10px; padding: 0 13px; }
  .player-menu div { display: none; }
  #content { width: min(100% - 22px, 1240px); margin-top: 28px; }
  .grid.cards, .grid.two, .election-calendar { grid-template-columns: 1fr; }
  .page-head, .section-title { align-items: start; flex-direction: column; gap: 10px; }
  .section-title > p { text-align: left; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form .wide { grid-column: auto; }
  .election-summary { align-items: start; flex-direction: column; }
  .election-application, .invite-card, .search-bar, .page-actions { align-items: stretch; flex-direction: column; }
  .invite-card .actions { margin-top: 4px; }
  .search-bar > div { width: 100%; }
  .vote-counter { width: 100%; padding: 15px 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: left; }
  .candidate { grid-template-columns: 45px 1fr; }
  .candidate .mc-button { grid-column: 1 / -1; }
  .counting-progress { grid-template-columns: 1fr; }
  .counting-partials { grid-template-columns: 1fr; }
  .counting-candidate { grid-template-columns: 25px 70px 1fr auto; gap: 8px; }
  .counting-avatar { width: 68px; height: 68px; }
  .counting-avatar img { width: 52px; height: 52px; }
  .counting-percentage { font-size: 16px; }
  .live-counting footer { flex-direction: column; gap: 5px; }
  .history-card-summary { align-items: flex-start; padding: 16px; }
  .history-details { padding: 0 12px 12px; }
  .history-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-chart-row { grid-template-columns: 25px 42px minmax(0, 1fr); gap: 8px; padding: 10px 8px; }
  .history-chart-row > img { width: 40px; height: 40px; }
  .history-chart-row > .result-seal { grid-column: 3; justify-self: start; }
  .history-chart-row > div > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .card { padding: 16px; }
  .receipt { grid-template-columns: 1fr; }
  .elitegram-panel { inset: 0; width: 100%; height: 100%; }
  .elitegram-toggle { right: 15px; bottom: 15px; }
  .elitegram-body { grid-template-columns: 112px 1fr; }
  .elitegram-tools { display: grid; }
  .conversation-item { display: grid; justify-items: center; padding: 10px 5px; text-align: center; }
  .conversation-item div { width: 100%; }.conversation-item small { display: none; }
  .president-entry { grid-template-columns: 35px 52px 1fr; gap: 10px; }
  .president-entry img { width: 52px; height: 52px; }
  .newspaper-cover { align-items: stretch; flex-direction: column; }
}
@media (max-width: 480px) {
  .brand-block small { letter-spacing: 3px; }
  .brand-logo { width: 145px; }
  .history-card-summary { flex-direction: column; gap: 14px; }
  .history-card-summary > div:last-child { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .history-card-summary > div:last-child span { margin-top: 0; }
  .history-march { grid-template-columns: 1fr; }
  .history-march > div:nth-child(2), .history-march small { grid-column: auto; }
  .calendar-card { grid-template-columns: 48px 1fr; }
  .calendar-date { padding: 0; border: 0; text-align: left; }
  .calendar-info { grid-column: 1 / -1; }
  .calendar-info dl div { align-items: start; flex-direction: column; gap: 4px; }
  .calendar-info dd { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
