:root {
  color-scheme: dark;
  --base: #0d0d0f;
  --surface: #17171a;
  --panel: #101012;
  --panel-soft: #131316;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --ink: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.48);
  --muted-strong: rgba(255, 255, 255, 0.7);
  --gold: #f4c430;
  --green: #4cdb87;
  --red: #ff6673;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--base); }
body { min-height: 100vh; margin: 0; background: var(--base); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button:not(:disabled), a[href], select:not(:disabled), [role="button"] { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: default !important; opacity: .52; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.is-hidden { display: none !important; }

.topbar { position: sticky; z-index: 50; top: 0; min-height: 56px; padding: 0 24px; border-bottom: 1px solid rgba(245,245,245,.05); background: rgba(23,23,26,.84); backdrop-filter: blur(12px); }
.topbar-inner { display: grid; grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr); align-items: center; width: 100%; min-height: 56px; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-logo { display: grid; width: 30px; height: 30px; overflow: hidden; place-items: center; border-radius: 7px; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand strong { font-size: .875rem; letter-spacing: .01em; text-transform: uppercase; }
.top-nav { display: flex; height: 56px; align-items: stretch; gap: 24px; }
.top-nav a { display: flex; min-height: 56px; padding: 0; align-items: center; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); font-size: .875rem; font-weight: 650; text-decoration: none; }
.top-nav a:hover, .top-nav a.is-active { background: transparent; color: var(--ink); box-shadow: inset 0 -1px rgba(255,255,255,.65); }
.account-area { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.identity-name { max-width: 210px; overflow: hidden; color: rgba(255,255,255,.75); font-size: .875rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu { position: relative; }
.avatar-button { position: relative; display: grid; width: 34px; height: 34px; min-height: 34px; padding: 0; overflow: hidden; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; background: #242429; color: var(--ink); font-size: .75rem; font-weight: 800; }
.avatar-button:hover { border-color: rgba(244,196,48,.65); }
.avatar-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-button img:not([src]), .avatar-button img[src=""] { display: none; }
.account-menu { position: absolute; z-index: 80; top: calc(100% + 9px); right: 0; width: 150px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 7px; background: #1d1d21; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.account-menu button { display: flex; width: 100%; min-height: 36px; padding: 0 10px; align-items: center; gap: 9px; border: 0; border-radius: 5px; background: transparent; color: rgba(255,255,255,.78); font-size: .875rem; text-align: left; }
.account-menu button:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.account-menu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { width: min(1440px, calc(100vw - 32px)); margin: 24px auto 48px; }
.summary-grid, .raffle-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.summary-grid article, .raffle-summary-grid article { display: grid; min-height: 104px; padding: 20px 22px; align-content: center; justify-items: center; gap: 8px; border: 0; border-radius: var(--radius); background: var(--surface); text-align: center; }
.summary-grid span, .raffle-summary-grid span { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.summary-grid strong, .raffle-summary-grid strong { color: var(--ink); font-size: 1.45rem; line-height: 1; }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.service-card { position: relative; min-height: 116px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: 0 18px 36px rgba(0,0,0,.22); }
.service-body { display: grid; gap: 16px; padding: 14px; }
.service-heading-block { display: grid; min-width: 0; gap: 8px; }
.service-title { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.service-identity { display: flex; min-width: 0; align-items: center; gap: 10px; }
.service-identity img { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; object-fit: cover; }
.service-title h2 { margin: 0; overflow: hidden; color: var(--ink); font-size: .95rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.token-health { overflow: hidden; color: var(--muted); font-size: .72rem; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.token-health.error { color: var(--red); }
.token-health.success { color: var(--green); }
.token-health.active { color: var(--gold); }
.token-health.saved { color: var(--green); }
.status-pill { display: inline-flex; min-height: 24px; padding: 0 9px; align-items: center; border: 1px solid rgba(255,102,115,.34); border-radius: 999px; background: rgba(255,102,115,.11); color: #ff8b95; font-size: .69rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.status-pill.running { border-color: rgba(76,219,135,.34); background: rgba(76,219,135,.1); color: var(--green); }
.status-pill.twitter { border-color: rgba(244,196,48,.45); background: rgba(244,196,48,.11); color: var(--gold); }
.service-controls { display: flex; align-items: center; gap: 8px; }
.control-button { display: grid; width: 34px; height: 34px; min-height: 34px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: #19191d; color: rgba(255,255,255,.7); }
.control-button:hover { border-color: rgba(244,196,48,.55); background: rgba(244,196,48,.08); color: var(--gold); }
.control-button.primary-control { border-color: rgba(244,196,48,.5); color: var(--gold); }
.control-button.settings-control { position: absolute; right: 4px; bottom: 4px; margin: 0; border: 0; background: transparent; color: #f8fafc; box-shadow: none; }
.control-button.settings-control:hover, .control-button.settings-control:focus-visible { border: 0; background: transparent; color: #f8fafc; }
.control-button.settings-control svg { color: #f8fafc; stroke: #f8fafc; transform-origin: center; will-change: transform; transition: color 140ms ease, transform 140ms ease; }
.control-button.settings-control:hover svg, .control-button.settings-control:focus-visible svg { color: #f8fafc; stroke: #f8fafc; transform: rotate(45deg); }
.control-button.settings-control:active svg { transform: rotate(45deg) scale(.88); transition-duration: 70ms; }
.control-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.control-button.primary-control svg.play-icon { width: 15px; fill: currentColor; stroke: none; }

.section-block { margin-top: 28px; }
.section-heading { display: flex; margin-bottom: 12px; align-items: end; justify-content: space-between; gap: 18px; }
.section-heading h1, .section-heading h2 { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.3; }
.section-heading h1 { font-size: 1.2rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.page-section-heading { margin: 2px 0 16px; }
.raffle-summary-grid { margin-bottom: 24px; }
.raffle-summary-grid article:nth-child(2) strong { color: var(--green); }
.raffle-summary-grid article:nth-child(3) strong { color: var(--red); }
.raffle-toolbar { position: relative; z-index: 5; display: grid; margin-bottom: 28px; padding: 16px; grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(180px, 240px)) auto; align-items: end; gap: 12px; border: 0; border-radius: 16px; background: var(--surface); }
.luckygo-toolbar { grid-template-columns: minmax(280px, 1fr) minmax(180px, 240px) 36px; }
.raffle-retry-button { display: inline-flex; height: 36px; min-height: 36px; padding-inline: 14px; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.raffle-retry-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.luckygo-refresh { display: grid; width: 36px; height: 36px; padding: 0; place-items: center; align-self: end; justify-self: end; border: 0; border-radius: 0; background: transparent; color: rgba(255,255,255,.82); transition: color 150ms ease, transform 150ms ease; }
.luckygo-refresh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.luckygo-refresh:hover, .luckygo-refresh:focus-visible { outline: 0; color: var(--gold); }
.luckygo-refresh:active:not(:disabled) { transform: rotate(-24deg); }
.luckygo-refresh:disabled { cursor: default; opacity: .42; }
.raffle-filter { display: grid; min-width: 0; gap: 7px; }
.raffle-filter > span { color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.raffle-filter-input { width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; outline: 0; background: var(--base); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); font-size: .875rem; font-weight: 700; transition: box-shadow 150ms ease; }
.raffle-filter-input::placeholder { color: var(--muted); }
.raffle-filter-input:focus, .raffle-filter-input:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--gold); }
.raffle-filter-select { position: relative; min-width: 0; }
.raffle-select-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.raffle-select-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.raffle-select-button i { width: 15px; height: 15px; flex: 0 0 15px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-opacity='.85' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.raffle-filter-select.is-open .raffle-select-button { border-bottom-right-radius: 0; border-bottom-left-radius: 0; box-shadow: inset 0 0 0 1px var(--gold); }
.raffle-filter-select:not(.is-open) .raffle-select-button:focus, .raffle-filter-select:not(.is-open) .raffle-select-button:focus-visible { box-shadow: inset 0 0 0 1px var(--border); }
.raffle-select-menu { position: absolute; z-index: 70; top: 100%; right: 0; left: 0; max-height: min(22rem, calc(100vh - 12rem)); padding: .35rem .35rem .5rem; overflow: auto; border: 0; border-radius: 0 0 .65rem .65rem; background: var(--base); box-shadow: 0 18px 44px rgba(0,0,0,.45), inset 1px 0 0 var(--gold), inset -1px 0 0 var(--gold), inset 0 -1px 0 var(--gold); scrollbar-width: none; }
.raffle-select-menu::-webkit-scrollbar { display: none; }
.raffle-select-menu button { display: flex; width: 100%; min-height: 36px; padding: .5rem .65rem; align-items: center; border: 0; border-radius: .4rem; background: transparent; color: var(--ink); font-size: .875rem; font-weight: 700; text-align: left; }
.raffle-select-menu button:hover, .raffle-select-menu button:focus-visible, .raffle-select-menu button.is-active { outline: 0; background: rgba(255,255,255,.08); color: var(--ink); }
.coverage-list { display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--border); }
.coverage-row { display: grid; min-height: 58px; padding: 10px 12px; grid-template-columns: 42px minmax(0,1fr) auto auto; align-items: center; gap: 12px; background: var(--panel); }
.coverage-row.coverage-empty { grid-template-columns: 42px minmax(0,1fr) auto; }
.coverage-row + .coverage-row { border-top: 1px solid var(--border); }
.wallet-family-logo { position: relative; display: inline-grid; width: 36px; height: 36px; place-items: center; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 8px; background: #1d1d21; color: var(--gold); }
.wallet-family-logo img { position: relative; z-index: 1; display: block; width: 26px; height: 26px; object-fit: contain; }
.wallet-family-logo[data-family="algorand"] img, .wallet-family-logo[data-family="xrp"] img { filter: invert(1); }
.wallet-family-logo-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: .62rem; font-weight: 900; letter-spacing: .04em; }
.wallet-family-logo.has-image .wallet-family-logo-fallback { display: none; }
.wallet-family-logo-empty svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.row-copy { display: grid; min-width: 0; gap: 3px; }
.row-copy strong { overflow: hidden; color: rgba(255,255,255,.88); font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.row-copy span { overflow: hidden; color: var(--muted); font-size: .75rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.row-value { color: var(--muted-strong); font-size: .75rem; font-weight: 750; white-space: nowrap; }

.raffle-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; gap: 16px; }
.raffle-card { display: flex; min-width: 0; height: 100%; padding: 12px; flex-direction: column; gap: 12px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: none; }
.raffle-image { position: relative; display: grid; width: 100%; aspect-ratio: 1; overflow: hidden; place-items: center; border-radius: 12px; background: var(--base); }
.raffle-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.raffle-card-heading { display: flex; min-width: 0; min-height: 66px; flex-direction: column; gap: 10px; }
.raffle-meta { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; color: #7f8e9d; font-size: .72rem; font-weight: 750; }
.raffle-provider { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-pill { display: inline-flex; max-width: 58%; padding: 4px 8px; align-items: center; justify-content: center; overflow: hidden; border: 0; border-radius: 999px; background: var(--gold); color: #0d0d0f; font-size: .68rem; font-weight: 800; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.raffle-card h2 { min-height: 38px; margin: 0; overflow: hidden; color: var(--ink); display: -webkit-box; font-size: .875rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.raffle-card h2 a, .raffle-card h2 span { color: inherit; text-decoration: none; }
.raffle-card h2 a:hover { color: var(--gold); text-decoration: none; }
.raffle-card h2 a:focus-visible { border-radius: 3px; outline: 2px solid var(--gold); outline-offset: 2px; }
.raffle-details { display: grid; margin: 0; overflow: hidden; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border); }
.raffle-card dl > div { display: flex; min-width: 0; min-height: 31px; padding: 7px 10px; align-items: center; justify-content: space-between; gap: 12px; }
.raffle-card dl > div + div { border-top: 1px solid var(--border); }
.raffle-card dt { color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.raffle-card dd { max-width: 70%; margin: 0; overflow: hidden; color: var(--ink); font-size: .76rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.raffle-card dd.raffle-state { width: auto; padding: 0; background: transparent; color: var(--muted-strong); font-size: .76rem; font-weight: 850; }
.raffle-card dd.raffle-state.pending { color: var(--gold); }
.raffle-card dd.raffle-state.won { color: var(--green); }
.raffle-card dd.raffle-state.lost { color: var(--red); }
.raffle-card dd.raffle-state.not-registered { color: var(--muted-strong); }
.raffle-card footer { display: flex; margin-top: auto; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .7rem; }
.luckygo-card-footer > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.luckygo-card-footer time { margin-left: auto; text-align: right; }
.raffle-pagination, .luckygo-pagination { display: flex; margin-top: 24px; align-items: center; justify-content: center; gap: 14px; }
.raffle-pagination span, .luckygo-pagination span { min-width: 150px; color: var(--muted); font-size: .78rem; font-weight: 750; text-align: center; }
.raffle-pagination button:disabled, .luckygo-pagination button:disabled { cursor: default; opacity: .42; }
.activity-status { color: var(--red); font-weight: 800; text-transform: capitalize; }
.activity-status.success { color: var(--green); }
.activity-status.warning { color: var(--gold); }
.activity-status[href] { text-decoration: none; }
.activity-status[href]:hover { color: #ff8b95; }
.activity-status[href]:focus-visible { border-radius: 3px; outline: 2px solid var(--gold); outline-offset: 3px; }
.empty-state { grid-column: 1 / -1; display: grid; min-height: 150px; padding: 28px; place-items: center; align-content: center; gap: 6px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--panel); text-align: center; }
.empty-state strong { font-size: .9rem; }
.empty-state span { color: var(--muted); font-size: .78rem; }

.primary-button, .secondary-button, .danger-button, .text-button { min-height: 34px; padding: 0 12px; border-radius: 6px; font-size: .78rem; font-weight: 800; }
.primary-button { border: 1px solid var(--gold); background: var(--gold); color: #111; }
.primary-button:hover { background: #ffd84e; }
.secondary-button { border: 1px solid var(--border-strong); background: #1a1a1e; color: rgba(255,255,255,.78); }
.secondary-button:hover { border-color: rgba(244,196,48,.55); color: var(--gold); }
.danger-button { border: 1px solid rgba(255,102,115,.4); background: rgba(255,102,115,.1); color: #ff8b95; }
.text-button { display: inline-flex; padding: 0; align-items: center; border: 0; background: transparent; color: var(--gold); text-decoration: none; }
.text-button:hover { color: #ffe16d; }
.login-view { display: grid; min-height: calc(100vh - 56px); padding: 24px; place-items: center; }
.login-card { width: min(430px, 100%); padding: 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: 0 28px 70px rgba(0,0,0,.4); text-align: center; }
.login-logo { width: 76px; height: 76px; border-radius: 18px; object-fit: cover; }
.login-card h1 { margin: 18px 0 8px; font-size: 1.35rem; }
.login-card > p { margin: 0 auto 22px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.discord-button { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 10px; border-radius: 7px; background: #5865f2; color: #fff; font-size: .875rem; font-weight: 800; text-decoration: none; }
.discord-button:hover { background: #6874f5; }
.discord-button svg { width: 20px; fill: currentColor; }

.modal { width: min(540px, calc(100% - 40px)); max-height: calc(100vh - 40px); padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.modal::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(3px); }
.modal form { display: grid; max-height: calc(100vh - 40px); padding: 22px; overflow-y: auto; gap: 18px; }
.modal-head { display: flex; margin: 0; align-items: flex-start; justify-content: space-between; gap: 16px; }
.eyebrow { display: block; color: var(--gold); font-size: .68rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.modal h2 { margin: 5px 0 0; font-size: 1.15rem; }
.icon-button { display: grid; width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--muted); box-shadow: none; }
.icon-button:hover { border-color: var(--border); background: var(--panel-soft); color: var(--ink); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal label { display: grid; margin: 0; gap: 7px; color: rgba(255,255,255,.76); font-size: .78rem; font-weight: 750; }
.modal-field { display: grid; gap: 7px; }
.modal-field > label { display: block; }
.modal select, .modal textarea, .modal input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 6px; outline: 0; background: var(--panel); color: var(--ink); font-size: .875rem; }
.modal textarea { resize: vertical; line-height: 1.45; }
.modal select:focus, .modal textarea:focus, .modal input:focus { border-color: var(--gold); }
.modal .proxy-remove { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .75rem; font-weight: 650; cursor: pointer; }
.modal .proxy-remove.is-hidden { display: none; }
.modal .proxy-remove input { width: 15px; height: 15px; margin: 0; padding: 0; accent-color: var(--gold); cursor: pointer; }
.wallet-native-select { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; opacity: 0 !important; pointer-events: none !important; }
.wallet-select { position: relative; width: 100%; min-width: 0; }
.wallet-select-button { display: flex; width: 100%; height: 2.25rem; min-height: 2.25rem; padding: 0 .75rem; align-items: center; justify-content: space-between; gap: .75rem; border: 0; border-radius: .5rem; background: var(--base); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); font-size: .875rem; font-weight: 700; line-height: 1.25rem; text-align: left; }
.wallet-select-button > span { min-width: 0; }
.wallet-select-current { display: flex; overflow: hidden; align-items: center; gap: .6rem; }
.wallet-select-current #walletFamilyLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-family-logo-compact { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 6px; }
.wallet-family-logo-compact img { width: 19px; height: 19px; }
.wallet-family-logo-compact .wallet-family-logo-fallback { font-size: .52rem; }
.wallet-select-button > i { width: .9rem; height: .9rem; flex: 0 0 .9rem; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-opacity='0.85' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); transition: transform 140ms ease; }
.wallet-select.is-open .wallet-select-button { border-bottom-right-radius: 0; border-bottom-left-radius: 0; box-shadow: inset 0 0 0 1px var(--gold); }
.wallet-select.is-open .wallet-select-button > i { transform: rotate(180deg); }
.wallet-select-menu { position: absolute; z-index: 100; top: 100%; right: 0; left: 0; max-height: min(22rem, calc(100vh - 12rem)); padding: .35rem .35rem .5rem; overflow: auto; border-radius: 0 0 .65rem .65rem; background: var(--base); box-shadow: 0 18px 44px rgba(0,0,0,.45), inset 1px 0 0 var(--gold), inset -1px 0 0 var(--gold), inset 0 -1px 0 var(--gold); scrollbar-width: none; }
.wallet-select-menu::-webkit-scrollbar { display: none; }
.wallet-select-option { display: flex; width: 100%; min-height: 44px; padding: .45rem .65rem; align-items: center; gap: .65rem; border: 0; border-radius: .4rem; background: transparent; color: var(--ink); font-size: .875rem; font-weight: 700; line-height: 1.25rem; text-align: left; }
.wallet-select-option:hover, .wallet-select-option:focus-visible, .wallet-select-option.is-active { outline: 0; background: rgba(255,255,255,.08); }
.wallet-select-option-copy { display: grid; min-width: 0; gap: .08rem; }
.wallet-select-option-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-select-option small { display: block; color: var(--muted); font-size: .7rem; font-weight: 600; line-height: 1.2; }
.form-note { margin: -5px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.modal-actions { display: flex; margin: 0; padding-top: 2px; justify-content: flex-end; gap: 9px; }
.modal-spacer { flex: 1; }
.platform-requirement { display: grid; padding: 12px; grid-template-columns: 54px minmax(0,1fr); align-items: start; gap: 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); }
.platform-requirement img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; }
.platform-requirement strong { display: block; font-size: .82rem; }
.platform-requirement p { margin: 5px 0 7px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.platform-requirement a { color: var(--gold); font-size: .74rem; font-weight: 750; text-decoration: none; }
.platform-modal { width: min(660px, calc(100% - 40px)); }
.timing-settings { display: grid; gap: 12px; padding-top: 17px; border-top: 1px solid var(--border); }
.timing-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.timing-heading strong { color: var(--ink); font-size: .82rem; }
.timing-heading span { color: var(--muted); font-size: .72rem; }
.timing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.timing-note { margin: 0; }
.log-modal { width: min(780px, calc(100% - 28px)); }
.log-modal pre { max-height: min(62vh, 560px); margin: 0; padding: 15px; overflow: auto; border: 1px solid var(--border); border-radius: 7px; background: #09090a; color: rgba(255,255,255,.72); font: .75rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.retry-raffle-modal { width: min(1320px, calc(100% - 40px)); max-height: calc(100vh - 40px); margin: 20px auto; }
.retry-raffle-modal form { max-height: calc(100vh - 40px); grid-template-rows: auto auto auto minmax(0, 1fr) auto; overflow: hidden; }
.retry-raffle-search input { height: 42px; background: var(--base); }
.retry-raffle-note { margin-top: -8px; }
.retry-raffle-grid { display: grid; min-height: 220px; padding-right: 3px; overflow-y: auto; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: max-content; align-items: start; align-content: start; gap: 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.retry-raffle-grid .empty-state { min-height: 220px; }
.retry-raffle-card { height: auto; min-height: 0; }
.retry-raffle-card .raffle-image { height: auto; min-height: 0; flex: 0 0 auto; aspect-ratio: 1; }
.retry-raffle-card .raffle-card-heading { min-height: 64px; }
.retry-raffle-card footer { display: grid; margin-top: auto; align-items: stretch; gap: 9px; }
.retry-raffle-result { min-height: 17px; overflow: hidden; color: var(--muted); font-size: .69rem; font-weight: 750; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.retry-raffle-result.success { color: var(--green); }
.retry-raffle-result.warning { color: var(--gold); }
.retry-raffle-result.error { color: var(--red); }
.retry-raffle-actions { display: flex; min-height: 36px; align-items: center; justify-content: space-between; gap: 16px; }
.retry-raffle-actions span { color: var(--muted); font-size: .75rem; font-weight: 700; line-height: 1.35; }
.retry-raffle-actions button { min-width: 150px; }
.fcfs-create-panel { margin-top: 24px; padding: 20px; border-radius: 16px; background: var(--surface); }
.fcfs-heading { margin-bottom: 18px; }
.fcfs-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fcfs-field { display: grid; min-width: 0; gap: 7px; color: rgba(255,255,255,.76); font-size: .78rem; font-weight: 750; }
.fcfs-field > span { display: block; }
.fcfs-field input, .fcfs-field textarea { width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; outline: 0; background: var(--base); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); font-size: .875rem; font-weight: 650; }
.fcfs-field input { height: 36px; }
.fcfs-field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.fcfs-field input:focus, .fcfs-field textarea:focus { box-shadow: inset 0 0 0 1px var(--gold); }
.fcfs-description { grid-column: 1 / -1; }
.fcfs-submit-row { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 18px; }
.fcfs-submit-row > span { color: var(--muted); font-size: .74rem; line-height: 1.45; }
.fcfs-submit-row .primary-button { min-width: 145px; }
.fcfs-setup-notice { margin-bottom: 16px; padding: 11px 13px; border: 1px solid rgba(244,196,48,.28); border-radius: 8px; background: rgba(244,196,48,.08); color: #ffe16d; font-size: .78rem; line-height: 1.45; }
.fcfs-select .raffle-select-menu button { gap: 9px; }
.fcfs-select .raffle-select-menu button > span:nth-child(2) { min-width: 0; overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.fcfs-select .raffle-select-menu small { flex: 0 0 auto; color: var(--muted); font-size: .62rem; font-weight: 650; }
.fcfs-role-dot { display: block; width: 9px; height: 9px; flex: 0 0 9px; }
.fcfs-selected-value { display: flex; min-width: 0; align-items: center; gap: 9px; }
.fcfs-selected-value > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcfs-server-icon { display: grid; width: 22px; height: 22px; overflow: hidden; flex: 0 0 22px; place-items: center; border-radius: 7px; background: #29292e; }
.fcfs-server-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fcfs-server-icon-fallback { color: rgba(255,255,255,.78); font-size: .57rem; font-weight: 900; letter-spacing: .02em; }
.fcfs-server-mark, .fcfs-channel-mark { width: 13px; flex: 0 0 13px; color: var(--gold); font-size: .7rem; font-weight: 900; text-align: center; }
.fcfs-family-icon { width: 20px; height: 20px; flex: 0 0 20px; object-fit: contain; }
.fcfs-history-panel { padding-bottom: 10px; }
.fcfs-history { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fcfs-history-card { display: flex; min-width: 0; height: 100%; padding: 18px; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.fcfs-history-card > header { display: grid; min-width: 0; grid-template-columns: 44px minmax(0, 1fr) 28px; align-items: center; gap: 11px; }
.fcfs-project-heading { display: grid; min-width: 0; gap: 4px; }
.fcfs-history-card h3 { margin: 0; overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.fcfs-history-card h3 a { color: var(--ink); text-decoration: none; }
.fcfs-history-card h3 a:hover { color: var(--gold); }
.fcfs-project-heading > span { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.fcfs-project-avatar, .fcfs-context-avatar { position: relative; display: grid; overflow: hidden; place-items: center; background: var(--base); color: var(--gold); font-weight: 900; }
.fcfs-project-avatar { width: 44px; height: 44px; border-radius: 50%; font-size: .68rem; }
.fcfs-project-avatar img, .fcfs-context-avatar img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.fcfs-card-context { display: grid; margin-top: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fcfs-context-item { display: flex; min-width: 0; padding: 9px; align-items: center; gap: 8px; border-radius: 8px; background: var(--base); }
.fcfs-context-avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; font-size: .52rem; }
.fcfs-server-avatar, .fcfs-network-avatar { border-radius: 7px; }
.fcfs-network-avatar img { padding: 3px; object-fit: contain; }
.fcfs-context-item > span { display: grid; min-width: 0; gap: 2px; }
.fcfs-context-item small, .fcfs-context-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcfs-context-item small { color: var(--muted); font-size: .58rem; font-weight: 750; }
.fcfs-context-item strong { color: rgba(255,255,255,.84); font-size: .68rem; }
.fcfs-channel-symbol { margin-right: 2px; color: var(--gold); font-weight: 900; }
.fcfs-status { flex: 0 0 auto; color: var(--muted); font-size: .7rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.fcfs-status.active { color: var(--green); }
.fcfs-status.closed { color: var(--red); }
.fcfs-status.failed { color: var(--red); }
.fcfs-status.publishing { color: var(--gold); }
.fcfs-delete { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; border-radius: 6px; background: transparent; color: rgba(255,255,255,.48); cursor: pointer; transition: background-color .16s ease, color .16s ease, transform .09s ease; }
.fcfs-delete:hover, .fcfs-delete:focus-visible { outline: 0; background: rgba(255,102,115,.1); color: var(--red); }
.fcfs-delete:active { transform: scale(.96); }
.fcfs-delete:disabled { opacity: .45; cursor: wait; }
.fcfs-delete svg { display: block; width: 15px; height: 15px; }
.fcfs-history-card > p { min-height: 40px; margin: 15px 0; overflow-wrap: anywhere; color: var(--muted-strong); font-size: .78rem; line-height: 1.55; }
.fcfs-history-card > .fcfs-publish-error { min-height: 0; margin: -6px 0 13px; color: var(--red); }
.fcfs-progress-status { display: flex; margin-top: auto; margin-bottom: 4px; justify-content: flex-end; }
.fcfs-progress-copy { display: flex; margin-bottom: 8px; align-items: center; justify-content: space-between; gap: 10px; }
.fcfs-progress-copy strong { color: rgba(255,255,255,.82); font-size: .74rem; }
.fcfs-progress-copy time { color: var(--muted); font-size: .62rem; white-space: nowrap; }
.fcfs-progress { display: block; width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 999px; background: rgba(255,255,255,.08); appearance: none; }
.fcfs-progress::-webkit-progress-bar { border-radius: 999px; background: rgba(255,255,255,.08); }
.fcfs-progress::-webkit-progress-value { border-radius: 999px; background: var(--gold); }
.fcfs-progress::-moz-progress-bar { border-radius: 999px; background: var(--gold); }
.fcfs-card-bottom { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.fcfs-submission-area { min-width: 0; }
.fcfs-submission-actions { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.fcfs-submission-actions button { border: 0; background: transparent; color: var(--gold); cursor: pointer; }
.fcfs-submission-toggle { min-width: 0; padding: 5px 7px; border-radius: 5px; font-size: .66rem; font-weight: 800; white-space: nowrap; }
.fcfs-submission-toggle:hover, .fcfs-submission-toggle:focus-visible { outline: 0; background: rgba(244,196,48,.08); }
.fcfs-submission-actions button:disabled { color: var(--muted); opacity: .45; cursor: default; }
.fcfs-export-actions { display: flex; margin-left: auto; align-items: center; gap: 3px; }
.fcfs-export-button { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border-radius: 6px; color: rgba(255,255,255,.58); transition: background-color .16s ease, color .16s ease, transform .09s ease; }
.fcfs-export-button:hover, .fcfs-export-button:focus-visible { outline: 0; background: rgba(244,196,48,.08); color: var(--gold); }
.fcfs-export-button:active { transform: scale(.96); }
.fcfs-export-button svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fcfs-submissions { display: grid; margin-top: 12px; gap: 1px; overflow: hidden; border-radius: 7px; background: var(--border); }
.fcfs-submission-row { display: grid; min-width: 0; padding: 9px 10px; grid-template-columns: 24px minmax(130px, .8fr) minmax(180px, 1.4fr); align-items: center; gap: 9px; background: var(--panel-soft); }
.fcfs-position { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: rgba(244,196,48,.12); color: var(--gold); font-size: .65rem; font-weight: 850; }
.fcfs-submission-row > div { display: grid; min-width: 0; gap: 2px; }
.fcfs-submission-row strong, .fcfs-submission-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcfs-submission-row strong { font-size: .72rem; }
.fcfs-submission-row small { color: var(--muted); font-size: .62rem; }
.fcfs-submission-row code { overflow: hidden; color: var(--muted-strong); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.fcfs-empty-submissions { padding: 13px; background: var(--panel-soft); color: var(--muted); font-size: .72rem; text-align: center; }
.clipboard-proxy { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toast { position: fixed; z-index: 100; right: 20px; bottom: 20px; max-width: min(380px, calc(100% - 40px)); padding: 12px 15px; transform: translateY(16px); border: 1px solid var(--border-strong); border-radius: 7px; background: #242429; color: var(--ink); opacity: 0; pointer-events: none; transition: .18s ease; font-size: .78rem; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1279px) {
  .raffle-grid, .retry-raffle-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .raffle-grid, .retry-raffle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fcfs-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .topbar { padding-inline: 14px; }
  .topbar-inner { grid-template-columns: 1fr auto 1fr; }
  .top-nav { gap: 14px; }
  .service-grid, .raffle-grid, .retry-raffle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .identity-name { max-width: 130px; }
  .app-shell { width: min(100% - 28px, 1440px); }
  .raffle-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raffle-search-filter { grid-column: 1 / -1; }
  .raffle-retry-button { grid-column: 2; }
  .luckygo-toolbar { grid-template-columns: minmax(0, 1fr) 36px; }
  .fcfs-history { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; gap: 12px; }
  .brand strong, .identity-name { display: none; }
  .top-nav { justify-self: center; gap: 14px; }
  .summary-grid, .raffle-summary-grid, .service-grid, .raffle-grid, .raffle-toolbar, .retry-raffle-grid { grid-template-columns: 1fr; }
  .luckygo-toolbar { grid-template-columns: minmax(0, 1fr) 36px; }
  .raffle-toolbar:not(.luckygo-toolbar) .raffle-search-filter { grid-column: auto; }
  .raffle-retry-button { width: 100%; grid-column: auto; }
  .retry-raffle-modal { width: calc(100% - 20px); max-height: calc(100vh - 20px); margin: 10px auto; }
  .retry-raffle-modal form { max-height: calc(100vh - 20px); padding: 18px; }
  .retry-raffle-actions { align-items: stretch; flex-direction: column; }
  .retry-raffle-actions button { width: 100%; }
  .section-heading { align-items: flex-start; }
  .coverage-row { grid-template-columns: 38px minmax(0,1fr) auto; }
  .coverage-row .row-value { display: none; }
  .timing-heading { display: grid; gap: 3px; }
  .timing-grid { grid-template-columns: 1fr; }
  .login-view { padding: 14px; }
  .login-card { padding: 28px 22px; }
  .fcfs-form { grid-template-columns: 1fr; }
  .fcfs-description, .fcfs-submit-row { grid-column: auto; }
  .fcfs-submit-row { align-items: stretch; flex-direction: column; }
  .fcfs-submit-row .primary-button { width: 100%; }
  .fcfs-card-context { grid-template-columns: 1fr; }
  .fcfs-submission-actions { flex-wrap: wrap; }
  .fcfs-submission-row { grid-template-columns: 24px minmax(0, 1fr); }
  .fcfs-submission-row code { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .control-button.settings-control svg { transition: none; }
  .control-button.settings-control:hover svg, .control-button.settings-control:focus-visible svg, .control-button.settings-control:active svg { transform: none; }
}
