.host-app, .host-login, .host-loading {
  --host-bg: #080709;
  --host-panel: #171418;
  --host-raised: #241e28;
  --host-line: #3c333e;
  --host-light: #fff4ea;
  --host-muted: #c1b6c5;
  --host-accent: #d6b7ef;
  --host-attention: #e591d5;
  --host-radius: 20px;
  min-height: 100vh;
  background: var(--host-bg);
  color: var(--host-light);
  color-scheme: dark;
}

.host-app [hidden], .host-login [hidden] { display: none !important; }
.host-app :where(h1, h2, h3, p, ol), .host-login :where(h1, h2, h3, p) { margin: 0; }
.host-app :where(button, input, select), .host-login :where(button, input) { font: inherit; }
.host-app :focus-visible, .host-login :focus-visible { outline: 2px solid var(--host-accent); outline-offset: 3px; }
.host-app :where(button:enabled, select), .host-login button:enabled { cursor: pointer; }
.host-app [data-busy], .host-app[data-busy], .host-login[data-busy] { cursor: progress; }
.host-app svg, .host-login svg { flex: 0 0 auto; }

.host-top { border-bottom: 1px solid var(--host-line); }
.host-top__inner, .host-wrap { width: min(100% - 72px, 1330px); margin-inline: auto; }
.host-top__inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.host-brand { width: max-content; max-width: 100%; }
.host-brand .brand-icon { background: var(--host-accent); color: #1c101f; }
.host-top__right, .host-page-actions, .host-links, .host-dialog__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.host-connection {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--host-muted);
  font-size: .79rem;
  white-space: nowrap;
}
.host-connection::before, .host-phase { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--host-accent); }
.host-connection::before { content: ''; box-shadow: 0 0 0 3px #d6b7ef28; }
.host-connection--offline::before { background: var(--host-attention); box-shadow: 0 0 0 3px #e591d528; }
.host-phase--created, .host-phase--finished { background: var(--host-muted); }
.host-phase--paused { background: var(--host-attention); }

.host-wrap { padding: clamp(24px, 4vw, 52px) 0 60px; }
.host-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.host-page-heading > div:first-child { min-width: 0; }
.host-kicker { color: var(--host-muted); font-size: .74rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.host-app h1, .host-login h1 { margin-top: 6px; font-size: clamp(2.1rem, 4.5vw, 4.1rem); line-height: 1.03; font-weight: 850; letter-spacing: -.052em; overflow-wrap: anywhere; }

.host-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: .9rem;
  font-weight: 730;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.host-button span { overflow-wrap: anywhere; }
.host-button:active { filter: brightness(.91); }
.host-button:disabled { opacity: .46; cursor: default; }
.host-button--primary { background: var(--host-accent); color: #1c101f; }
.host-button--primary:hover:not(:disabled) { background: #ead3f9; color: #1c101f; }
.host-button--secondary { border-color: var(--host-line); background: var(--host-raised); color: var(--host-light); }
.host-button--secondary:hover:not(:disabled), .host-button--quiet:hover:not(:disabled), .host-button--icon:hover:not(:disabled) { border-color: #676078; background: #2b2638; color: var(--host-light); }
.host-button--quiet, .host-button--icon { background: transparent; color: var(--host-muted); }
.host-button--icon { width: 44px; padding: 0; }
.host-button[aria-pressed="true"] { color: var(--host-accent); border-color: #9866a8; background: #37233f; }

.host-selector { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; position: relative; min-width: 168px; max-width: 285px; color: var(--host-muted); }
.host-selector svg:first-of-type { position: absolute; left: 12px; pointer-events: none; }
.host-selector svg:last-of-type { position: absolute; right: 12px; pointer-events: none; transform: rotate(90deg); }
.host-selector select {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  appearance: none;
  border: 1px solid var(--host-line);
  border-radius: 10px;
  background: var(--host-panel);
  color: var(--host-light);
  font-size: .88rem;
  font-weight: 650;
  padding: 8px 36px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.host-feedback { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #704f7d; border-radius: 10px; background: #2c1e35; color: #f2dfff; overflow-wrap: anywhere; }
.host-feedback--error { border-color: #884b46; background: #372021; color: #ffb59f; }
.host-loading { display: grid; align-content: center; justify-items: center; font-weight: 700; }
.host-empty { text-align: center; min-height: min(410px, 62vh); display: grid; justify-items: center; align-content: center; gap: 14px; padding: 26px; border: 1px solid var(--host-line); border-radius: var(--host-radius); background: var(--host-panel); }
.host-empty p { max-width: 38ch; color: var(--host-muted); }
.host-empty__symbol { color: var(--host-accent); }

.host-overview { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.host-metrics { display: grid; grid-template-columns: minmax(160px, 1.45fr) repeat(2, minmax(102px, 1fr)); gap: 1px; border: 1px solid var(--host-line); border-radius: 13px; overflow: hidden; background: var(--host-line); }
.host-metric { display: grid; align-content: center; gap: 3px; min-height: 67px; min-width: 0; padding: 9px 16px; background: var(--host-panel); }
.host-metric__label { color: var(--host-muted); font-size: .72rem; }
.host-metric strong { display: flex; align-items: center; gap: 8px; min-height: 20px; font-weight: 760; font-size: 1.04rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.host-metric--status strong { font-size: .92rem; }

.host-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); align-items: stretch; gap: 16px; }
.host-deck, .host-prizes, .host-details { border: 1px solid var(--host-line); border-radius: var(--host-radius); background: var(--host-panel); }
.host-deck { display: flex; flex-direction: column; overflow: hidden; }
.host-current {
  isolation: isolate;
  position: relative;
  display: flex;
  flex: 1;
  align-items: stretch;
  min-height: 246px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
  background: radial-gradient(ellipse at 92% 17%, #38213c 0%, #251c2a 37%, #151116 73%);
}
.host-current__inner { display: grid; align-content: center; gap: 12px; width: min(100%, 37ch); position: relative; z-index: 1; }
.host-current__label { display: flex; align-items: center; gap: 9px; color: var(--host-accent); font-size: .73rem; font-weight: 770; letter-spacing: .09em; text-transform: uppercase; }
.host-current h2 { font-size: clamp(1.7rem, 4vw, 3.65rem); line-height: 1.085; letter-spacing: -.047em; font-weight: 825; overflow-wrap: anywhere; }
.host-current p { max-width: 45ch; color: var(--host-muted); font-size: .9rem; line-height: 1.45; }
.host-current .host-current__deadline { font-size: .77rem; font-variant-numeric: tabular-nums; }
.host-current__art { position: absolute; z-index: -1; right: 10px; top: 50%; transform: translateY(-45%) rotate(-12deg); opacity: .38; mask-image: linear-gradient(90deg, transparent 7%, black 70%); }
.host-pattern { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; width: clamp(160px, 18vw, 290px); }
.host-pattern span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; border: 1px solid #645578; color: var(--host-accent); font-size: clamp(1rem, 2.4vw, 2.5rem); line-height: 1; }
.host-pattern span:nth-child(5n + 1) { border-color: #be99d8; background: #d6b7ef; color: #2b1833; }
.host-pattern span:nth-child(3n):not(:nth-child(5n + 1)) { border-color: #a45398; color: #ee9fda; }

.host-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 18px; background: var(--host-panel); border-top: 1px solid var(--host-line); }
.host-controls .host-button { font-size: .84rem; }
.host-prizes { min-width: 0; padding: 20px; }
.host-prizes__heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.host-prizes__heading svg { color: var(--host-accent); }
.host-prizes h2, .host-details h2, .host-empty h2, .host-dialog h2 { font-size: 1.24rem; font-weight: 780; letter-spacing: -.025em; }
.host-prize-list { display: grid; gap: 7px; padding: 0; list-style: none; }
.host-prize {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 57px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #231d25;
  line-height: 1.2;
}
.host-prize--current { border-color: #8a5c9d; background: #291d31; }
.host-prize--won { border-color: #624b6e; }
.host-prize__number { display: grid; place-items: center; width: 38px; aspect-ratio: 1; border-radius: 8px; background: #302a3c; color: var(--host-muted); font-variant-numeric: tabular-nums; font-size: .85rem; font-weight: 770; }
.host-prize--current .host-prize__number, .host-prize--won .host-prize__number { background: var(--host-accent); color: #1c101f; }
.host-prize h3 { font-size: .92rem; font-weight: 740; }
.host-prize__status { display: block; margin-top: 2px; color: var(--host-muted); font-size: .74rem; }
.host-prize--current .host-prize__status { color: #e1c4f5; }
.host-prize__winner { display: block; margin-top: 3px; color: var(--host-accent); font-size: .88rem; overflow-wrap: anywhere; }

.host-details { margin-top: 16px; padding: 0 20px 20px; }
.host-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 14px; min-height: 54px; margin-bottom: 17px; border-bottom: 1px solid var(--host-line); }
.host-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin-bottom: -1px; padding: 7px 4px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--host-muted); font-size: .88rem; font-weight: 680; }
.host-tab:hover { color: var(--host-light); }
.host-tab[aria-pressed="true"] { border-bottom-color: var(--host-accent); color: var(--host-accent); }
.host-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.host-section-heading--audit { margin-top: 27px; }
.host-section-empty { padding: 15px; border: 1px dashed var(--host-line); border-radius: 10px; color: var(--host-muted); font-size: .9rem; }
.host-simulate { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.host-simulate input { width: 65px; }
.host-tag, .host-virtual { color: var(--host-muted); background: #282432; border: 1px solid #3e344c; border-radius: 6px; padding: 3px 7px; font-size: .72rem; }
.host-tag { font-variant-numeric: tabular-nums; }
.host-tag--ok { color: var(--host-accent); }

.host-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--host-line); border-radius: 10px; }
.host-table { border-spacing: 0; width: 100%; font-size: .9rem; line-height: 1.4; }
.host-table :where(th, td) { padding: 10px 12px; text-align: start; }
.host-table thead th { background: #231f2d; color: var(--host-muted); font-weight: 680; }
.host-table tbody tr + tr :where(th, td) { border-top: 1px solid var(--host-line); }
.host-table tbody th { width: 45%; font-weight: 650; overflow-wrap: anywhere; }
.host-table td { min-width: 60px; font-variant-numeric: tabular-nums; }
.host-table-prize { color: var(--host-accent); }
.host-virtual { display: inline-block; vertical-align: middle; margin: 2px 0 2px 5px; }
.host-history { list-style: none; padding: 0; border: 1px solid var(--host-line); border-radius: 10px; overflow: hidden; }
.host-history li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; font-size: .88rem; overflow-wrap: anywhere; }
.host-history li + li { border-top: 1px solid var(--host-line); }
.host-history__number { display: grid; place-items: center; width: 30px; aspect-ratio: 1; border-radius: 6px; background: var(--host-raised); color: var(--host-accent); font-weight: 730; font-variant-numeric: tabular-nums; }
.host-history time, .host-audit-method, .host-history small { color: var(--host-muted); font-size: .8rem; }
.host-audit-method { text-align: end; }
.host-audit-method time { display: block; }
.host-history small { display: block; margin-top: 3px; }

.host-form { display: grid; justify-items: start; align-items: start; gap: 14px; max-width: 660px; }
.host-form > fieldset { display: grid; gap: 12px; padding: 0; margin: 0; border: 0; width: 100%; min-width: 0; }
.host-form .host-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.host-form-error { color: #ffaf9b; font-size: .88rem; }
.host-form-feedback { padding: 8px 11px; border: 1px solid #704f7d; border-radius: 8px; background: #2c1e35; color: #f2dfff; overflow-wrap: anywhere; font-size: .88rem; }
.host-form-feedback.host-feedback--error { border-color: #884b46; background: #372021; color: #ffb59f; }
[data-panel="players"] > .host-form-feedback { margin-bottom: 12px; }
.host-field { display: grid; gap: 6px; min-width: 0; width: 100%; color: var(--host-muted); font-weight: 650; font-size: .83rem; }
.host-field--wide { grid-column: 1 / -1; }
.host-field input {
  background: #110d13;
  color: var(--host-light);
  border: 1px solid #4f4861;
  border-radius: 8px;
  min-height: 44px;
  min-width: 0;
  width: 100%;
  padding: 9px 11px;
  font-size: 1rem;
  font-weight: 550;
}
.host-field input:disabled { opacity: .7; }
.host-field input:focus { border-color: var(--host-accent); }
.host-simulate .host-field input { width: 64px; }
.host-help { color: var(--host-muted); font-size: .9rem; line-height: 1.5; }
.host-situation-form { max-width: none; }
.host-situation-form fieldset > button { justify-self: start; }
.host-situations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; }
.host-situations li { display: flex; align-items: end; gap: 4px; min-width: 0; }
.host-situations li .host-button { flex: 0 0 44px; }

.host-dialog {
  width: min(100% - 30px, 465px);
  max-height: calc(100dvh - 30px);
  padding: 0;
  border: 1px solid #4c465d;
  border-radius: var(--host-radius);
  background: var(--host-panel);
  color: var(--host-light);
}
.host-dialog::backdrop { background: #09070dd9; }
.host-dialog__body { display: grid; gap: 15px; padding: 22px; }
.host-dialog__heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.host-dialog__heading .host-button { margin: -7px -6px -7px 0; }
.host-dialog__actions { justify-content: end; }

.host-login { isolation: isolate; position: relative; display: grid; align-items: center; padding: 32px 22px; background: #070608; }
.host-login::before { content: ''; position: absolute; z-index: -1; inset: 0 auto 0 0; width: clamp(24px, 12vw, 190px); background: repeating-linear-gradient(31deg, transparent 0 38px, #2c292e 38px 61px); mask-image: linear-gradient(90deg, #000, transparent); }
.host-login__wrap { width: min(100%, 970px); margin-inline: auto; display: grid; gap: 18px; }
.host-login__brands { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.host-partners { width: clamp(120px, 18vw, 200px); height: auto; }
.host-login__card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); min-height: 418px; border: 1px solid var(--host-line); border-radius: calc(var(--host-radius) + 4px); overflow: hidden; background: #131015; }
.host-login__content { display: grid; align-content: center; gap: 11px; padding: clamp(24px, 5vw, 58px); }
.host-login__event { color: var(--host-accent); }
.host-login__content h1 { margin-top: 0; }
.host-login__content .host-form { margin-top: 10px; max-width: 330px; }
.host-login__content .host-button { min-width: 108px; }
.host-login__art { background: linear-gradient(90deg, #131015 1%, transparent 36%), #000 url('/assets/event/lounge.webp') 85% center / cover no-repeat; }

.host-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}

@media (max-width: 930px) {
  .host-top__inner, .host-wrap { width: min(100% - 48px, 1330px); }
  .host-layout { grid-template-columns: minmax(0, 1fr) minmax(245px, .75fr); }
  .host-current__art { opacity: .25; right: -44px; }
}

@media (max-width: 690px) {
  .host-top__inner, .host-wrap { width: calc(100% - 28px); }
  .host-top__inner { min-height: 62px; gap: 4px; }
  .host-top__right { justify-content: end; gap: 0; }
  .host-button--quiet { padding-inline: 8px; }
  .host-page-heading { align-items: start; flex-direction: column; gap: 15px; }
  .host-page-actions, .host-links, .host-metrics { width: 100%; }
  .host-selector { flex: 1 1 145px; min-width: 0; }
  .host-metrics { grid-template-columns: minmax(0, 1.48fr) repeat(2, minmax(0, 1fr)); }
  .host-metric { min-height: 60px; padding-inline: 8px; }
  .host-metric strong { gap: 5px; }
  .host-metric--status strong { font-size: .78rem; }
  .host-layout { grid-template-columns: minmax(0, 1fr); }
  .host-current { min-height: 205px; }
  .host-current__art { opacity: .26; right: 5px; }
  .host-prizes, .host-details { padding-inline: 14px; }
  .host-tabs { column-gap: 9px; }
  .host-tab { font-size: .81rem; }
  .host-tab svg { display: none; }
  .host-situations { grid-template-columns: minmax(0, 1fr); }
  .host-login__card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .host-login__art { min-height: 165px; background-image: linear-gradient(#131015 0%, transparent 22%), url('/assets/event/lounge.webp'); background-position: center, center 62%; }
}

@media (max-width: 405px) {
  .host-top__right .host-button svg { display: none; }
  .host-connection { font-size: .71rem; }
  .host-links .host-button { padding-inline: 9px; font-size: .82rem; }
  .host-table :where(th, td) { padding-inline: 7px; }
  .host-table td { min-width: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .host-button { transition: none; }
}
