/* System font stack — no external requests */
.ui-refresh {
  --ui-accent: #61f29b;
  --ui-accent-rgb: 97, 242, 155;
  --ui-panel: rgba(15, 21, 28, .88);
  --ui-line: rgba(255, 255, 255, .09);
}

.ui-refresh.ui-anzone {
  --ui-accent: #ff9f43;
  --ui-accent-rgb: 255, 159, 67;
}

.lobby-theme-preview {
  position: relative;
  min-height: 170px;
  margin: 0 14px 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background-position: center;
  background-size: cover;
  isolation: isolate;
}
.lobby-theme-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(5,8,11,.96), rgba(5,8,11,.54) 58%, rgba(5,8,11,.12));
}
.lobby-theme-anzone {
  border-color: rgba(255,159,67,.32);
  background-image: url('/__ui/anzone-hero.jpg');
}
.lobby-theme-delta {
  border-color: rgba(97,242,155,.32);
  background-image: url('/__ui/delta-hero.jpg');
}
.lobby-theme-copy {
  position: absolute;
  left: 20px;
  bottom: 18px;
  display: grid;
  gap: 5px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.65);
}
.lobby-theme-copy span {
  color: #aeb9c4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
}
.lobby-theme-anzone .lobby-theme-copy strong { color: #ffb66f; }
.lobby-theme-delta .lobby-theme-copy strong { color: #72f3a7; }
.lobby-theme-copy strong { font-size: 21px; }
.lobby-theme-copy small { color: #d3dae1; font-size: 11px; }

@media (min-width: 768px) {
  .game-lobby { max-width: 920px; margin-inline: auto; }
  .lobby-theme-preview { min-height: 220px; }
}

/* Homepage lobby — keep original game icons, organize existing artwork into
   two clear destination cards. These selectors intentionally override the
   legacy shared stylesheet only on the lobby. */
body:has(.game-lobby) {
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh;
  margin: 0 !important;
  padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,159,67,.09), transparent 27rem),
    radial-gradient(circle at 82% 12%, rgba(97,242,155,.10), transparent 29rem),
    #070a0e !important;
  color: #eaf0f6;
}
body:has(.game-lobby) .nav-bar .logo { color: #f2f6fa !important; }
body:has(.game-lobby)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
body:has(.game-lobby) > .nav-bar {
  width: min(1120px, calc(100% - 28px));
  min-height: 64px;
  margin: 0 auto;
  padding: 0 18px !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-top: 0 !important;
  border-radius: 0 0 16px 16px;
  background: rgba(8,12,17,.78) !important;
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 16px 42px rgba(0,0,0,.24);
}
.lobby-account-link {
  display: inline-flex !important;
  align-items: center;
  margin-left: auto;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 9px;
  color: #d9e2eb;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .2s, background .2s, color .2s;
}
.lobby-account-link:hover {
  border-color: rgba(97,242,155,.45);
  background: rgba(97,242,155,.08);
  color: #72f3a7;
}
body:has(.game-lobby) .game-lobby {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: min(1120px, calc(100% - 28px));
  max-width: none;
  margin: 0 auto;
  padding: 54px 0 20px;
}
body:has(.game-lobby) .lobby-title {
  grid-column: 1 / -1;
  margin: 0 0 14px;
  text-align: center;
}
.lobby-eyebrow {
  margin-bottom: 12px;
  color: #72f3a7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .20em;
}
body:has(.game-lobby) .lobby-title h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(31px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -.035em;
}
body:has(.game-lobby) .lobby-title p {
  margin: 12px 0 0;
  color: #95a3b2;
  font-size: 14px;
}
body:has(.game-lobby) .game-select-card {
  display: flex;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(19,26,34,.96), rgba(10,15,21,.96));
  box-shadow: 0 22px 64px rgba(0,0,0,.30);
  transform: translateY(0);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
body:has(.game-lobby) .game-select-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 75px rgba(0,0,0,.40);
}
body:has(.game-lobby) .game-select-anzone:hover { border-color: rgba(255,159,67,.42); }
body:has(.game-lobby) .game-select-delta:hover { border-color: rgba(97,242,155,.42); }
body:has(.game-lobby) .card-banner {
  flex: 0 0 78px;
  min-height: 100%;
  padding: 20px 14px;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  border-radius: 0;
  background: rgba(255,255,255,.025) !important;
}
body:has(.game-lobby) .card-banner img {
  width: 50px !important;
  height: 50px !important;
  filter: drop-shadow(0 7px 16px rgba(0,0,0,.38));
}
body:has(.game-lobby) .banner-tag {
  position: static;
  white-space: nowrap;
  font-size: 10px;
}
body:has(.game-lobby) .card-body {
  flex: 1 1 44%;
  min-width: 0;
  padding: 24px 18px;
}
body:has(.game-lobby) .game-name { font-size: 22px; }
body:has(.game-lobby) .game-desc { min-height: 42px; line-height: 1.7; }
body:has(.game-lobby) .entry-tags { gap: 6px; }
body:has(.game-lobby) .entry-tag {
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.035);
}
body:has(.game-lobby) .lobby-theme-preview {
  flex: 1 1 56%;
  min-width: 170px;
  min-height: 280px;
  margin: 0;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.07);
  border-radius: 0;
  background-position: 58% center;
}
body:has(.game-lobby) .lobby-theme-copy { left: 18px; bottom: 20px; }
.lobby-announcement {
  width: min(1120px, calc(100% - 28px));
  margin: 4px auto 0;
  text-align: center;
}
.lobby-announcement-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  padding: 11px 18px;
  border: 1px solid rgba(97,242,155,.32);
  border-radius: 11px;
  background: rgba(13,21,19,.76);
  color: #dce6e0;
  font: 13px/1.4 inherit;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
body:has(.game-lobby) .footer-info {
  margin-top: 20px;
  padding-bottom: 18px;
  color: #667584;
}
body:has(.game-lobby) > .bottom-nav {
  background: rgba(8,12,17,.94) !important;
  border-color: rgba(255,255,255,.08) !important;
  backdrop-filter: blur(18px);
  box-shadow: 0 -12px 34px rgba(0,0,0,.34);
}

@media (max-width: 900px) {
  body:has(.game-lobby) .game-lobby { grid-template-columns: 1fr; max-width: 650px; }
  body:has(.game-lobby) .lobby-theme-preview { min-height: 220px; }
}

@media (max-width: 560px) {
  body:has(.game-lobby) > .nav-bar { width: 100%; min-height: 58px; border-radius: 0; border-inline: 0 !important; }
  body:has(.game-lobby) .game-lobby { width: calc(100% - 20px); padding-top: 34px; gap: 13px; }
  body:has(.game-lobby) .lobby-title { margin-bottom: 8px; }
  .lobby-eyebrow { font-size: 9px; letter-spacing: .13em; }
  body:has(.game-lobby) .lobby-title h1 { font-size: 31px; }
  body:has(.game-lobby) .lobby-title p { max-width: 300px; margin-inline: auto; font-size: 12px; line-height: 1.7; }
  body:has(.game-lobby) .game-select-card { display: grid; grid-template-columns: 68px 1fr; border-radius: 17px; }
  body:has(.game-lobby) .card-banner { grid-row: 1; grid-column: 1; min-height: auto; padding: 17px 10px; }
  body:has(.game-lobby) .card-banner img { width: 44px !important; height: 44px !important; }
  body:has(.game-lobby) .card-body { grid-row: 1; grid-column: 2; padding: 17px 14px; }
  body:has(.game-lobby) .game-name { font-size: 19px; }
  body:has(.game-lobby) .game-desc { min-height: 0; margin-bottom: 10px; font-size: 11px; }
  body:has(.game-lobby) .entry-tag { padding: 4px 6px; font-size: 9px; }
  body:has(.game-lobby) .lobby-theme-preview { grid-column: 1 / -1; grid-row: 2; min-height: 168px; border-left: 0; border-top: 1px solid rgba(255,255,255,.07); background-position: center; }
  body:has(.game-lobby) .lobby-theme-copy { left: 16px; bottom: 15px; }
  .lobby-theme-copy strong { font-size: 18px; }
  .lobby-announcement { width: calc(100% - 20px); }
  .lobby-announcement-button { width: 100%; padding-inline: 12px; font-size: 11px; }
  .lobby-account-link { padding: 7px 10px; font-size: 11px; }
}

.ui-refresh body.sub-page {
  width: 100%;
  margin: 0;
  padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  background:
    radial-gradient(circle at 50% -20%, rgba(var(--ui-accent-rgb), .10), transparent 34rem),
    #070a0e !important;
  color: #e7edf4;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif !important;
}

.ui-refresh body.sub-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

.ui-refresh .nav-bar {
  position: sticky !important;
  top: 0;
  z-index: 120 !important;
  min-height: 62px;
  padding: 0 max(18px, calc((100vw - 1120px) / 2)) !important;
  background: rgba(6, 9, 13, .80) !important;
  border-bottom: 1px solid var(--ui-line) !important;
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 14px 35px rgba(0,0,0,.24);
}

.ui-refresh .nav-bar .logo {
  letter-spacing: .04em;
  font-weight: 800;
}

.council-hero {
  --hero-image: none;
  position: relative;
  min-height: 340px;
  max-width: 1120px;
  margin: 22px auto 28px;
  padding: 48px 48px 40px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border: 1px solid rgba(var(--ui-accent-rgb), .26);
  border-radius: 22px;
  isolation: isolate;
  box-shadow: 0 28px 80px rgba(0,0,0,.42), inset 0 0 0 1px rgba(255,255,255,.025);
}

.council-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  transform: scale(1.01);
}

.council-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(5,8,11,.97) 0%, rgba(5,8,11,.78) 42%, rgba(5,8,11,.16) 76%), linear-gradient(0deg, rgba(5,8,11,.58), transparent 65%);
}

.hero-content { max-width: 610px; }
.hero-eyebrow {
  color: var(--ui-accent);
  font: 700 12px/1 "Arial Narrow", "Helvetica Neue", "PingFang SC", sans-serif;
  letter-spacing: .19em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.council-hero h1 {
  margin: 0;
  color: white;
  font-size: clamp(35px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -.04em;
  text-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.council-hero h1 span {
  display: block;
  margin-top: 8px;
  color: rgba(255,255,255,.62);
  font-size: .34em;
  letter-spacing: .22em;
}
.council-hero p { max-width: 520px; margin: 18px 0 20px; color: #b7c2ce; font-size: 15px; line-height: 1.8; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-badges span {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  background: rgba(4,7,10,.48);
  color: #c4ced8;
  font-size: 11px;
  backdrop-filter: blur(8px);
}
.hero-badges span:first-child { border-color: rgba(var(--ui-accent-rgb), .35); color: var(--ui-accent); }
.hero-badges i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--ui-accent); box-shadow: 0 0 10px var(--ui-accent); }
.hero-action {
  position: absolute;
  right: 28px;
  bottom: 26px;
  padding: 11px 15px;
  border: 1px solid rgba(var(--ui-accent-rgb), .38);
  border-radius: 10px;
  background: rgba(5,8,11,.7);
  color: var(--ui-accent);
  font: 600 12px/1 "Noto Sans SC", sans-serif;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.hero-action b { margin-left: 8px; }

.ui-refresh .card {
  max-width: 920px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 24px !important;
  background: linear-gradient(145deg, rgba(20,27,35,.94), rgba(12,17,23,.94)) !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 42px rgba(0,0,0,.19);
}
.ui-refresh .card:hover { border-color: rgba(var(--ui-accent-rgb), .18) !important; }
.ui-refresh .card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f4f7fa !important;
  font-size: 16px !important;
  letter-spacing: .01em;
}
.ui-refresh .card-title::before {
  content: var(--step, "—");
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(var(--ui-accent-rgb), .3);
  border-radius: 8px;
  background: rgba(var(--ui-accent-rgb), .09);
  color: var(--ui-accent);
  font: 700 11px/1 "Arial Narrow", "Helvetica Neue", "PingFang SC", sans-serif;
}
.ui-refresh .form-input,
.ui-refresh .form-select,
.ui-refresh input[type="number"],
.ui-refresh textarea {
  min-height: 44px;
  background: rgba(5,9,13,.62) !important;
  border-color: rgba(255,255,255,.11) !important;
  border-radius: 10px !important;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.ui-refresh .form-input:focus,
.ui-refresh .form-select:focus,
.ui-refresh input:focus,
.ui-refresh textarea:focus {
  border-color: rgba(var(--ui-accent-rgb), .65) !important;
  box-shadow: 0 0 0 3px rgba(var(--ui-accent-rgb), .09) !important;
  background: rgba(8,13,18,.9) !important;
}
.ui-refresh .btn-opt { min-height: 42px; border-radius: 10px !important; }
.ui-refresh .btn-opt.active {
  border-color: rgba(var(--ui-accent-rgb), .7) !important;
  background: rgba(var(--ui-accent-rgb), .12) !important;
  color: var(--ui-accent) !important;
  box-shadow: inset 0 0 18px rgba(var(--ui-accent-rgb), .04);
}
.ui-refresh .btn-submit {
  background: var(--ui-accent) !important;
  color: #07100b !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 30px rgba(var(--ui-accent-rgb), .18);
}
.ui-refresh .quote-preview .amount { color: var(--ui-accent) !important; text-shadow: 0 0 28px rgba(var(--ui-accent-rgb), .18); }
.ui-refresh .file-upload { background: rgba(5,9,13,.38); border-radius: 13px !important; }
.ui-refresh .bottom-nav { background: rgba(8,12,17,.88) !important; backdrop-filter: blur(18px); }
.ui-refresh .bottom-nav[style*="position:fixed"],
.ui-refresh body.sub-page > .bottom-nav {
  box-shadow: 0 -12px 32px rgba(0,0,0,.32);
}
.ui-refresh .bottom-nav .nav-tab.active { color: var(--ui-accent) !important; }

body > .bottom-nav {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 1000 !important;
}
.site-bottom-nav {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1000 !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
  background: rgba(8,12,17,.96) !important;
  border-top: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 -10px 30px rgba(0,0,0,.38) !important;
  backdrop-filter: blur(18px);
}
.ui-refresh .section-switch-nav {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 12px 10px 14px !important;
  transform: none !important;
  z-index: auto !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  border-radius: 11px;
  background: rgba(12,18,25,.78) !important;
  box-shadow: none !important;
  overflow: hidden;
}
.ui-refresh .section-switch-nav .nav-tab {
  min-height: 46px;
}
body:not(:has(.game-lobby)) {
  padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
}

.test-environment-badge {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  padding: 8px 12px;
  border: 1px solid rgba(255, 190, 71, .65);
  border-radius: 999px;
  background: rgba(35, 20, 2, .94);
  color: #ffd27a;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  pointer-events: none;
}

/* The legacy base stylesheet caps desktop pages at 480px unless body.pc is
   present. Test templates do not load device-detect.js, so override that cap
   in the injected test-only layer instead of changing shared production CSS. */
@media (min-width: 768px) {
  .ui-refresh body.sub-page {
    max-width: none !important;
    margin: 0 !important;
  }

  .ui-refresh .nav-bar {
    width: calc(100% - 32px);
    max-width: 1120px;
    margin-inline: auto !important;
    padding-inline: 32px !important;
    border-radius: 0 0 14px 14px;
  }

  .council-hero {
    width: calc(100% - 32px);
  }

  .ui-refresh .main-tabs {
    width: calc(100% - 32px);
    max-width: 920px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .ui-refresh body.sub-page > [id^="page-"] {
    width: calc(100% - 32px);
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
  }

  .ui-refresh.ui-anzone .bottom-nav,
  .ui-refresh .bottom-nav[style*="position:fixed"] {
    left: 50% !important;
    right: auto !important;
    width: calc(100% - 32px);
    max-width: 1120px;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: translateX(-50%);
  }
}

@media (max-width: 760px) {
  .test-environment-badge { right: 8px; bottom: 72px; font-size: 10px; }
  .ui-refresh .nav-bar { min-height: 56px; padding-inline: 14px !important; }
  .council-hero { min-height: 310px; margin: 10px 10px 18px; padding: 30px 22px; border-radius: 17px; align-items: flex-end; }
  .council-hero::before { background-position: 63% center; }
  .council-hero::after { background: linear-gradient(90deg, rgba(5,8,11,.94), rgba(5,8,11,.58)), linear-gradient(0deg, rgba(5,8,11,.85), transparent 80%); }
  .council-hero p { margin: 14px 0 16px; font-size: 13px; }
  .hero-action { display: none; }
  .hero-badges span:nth-last-child(-n+2) { display: none; }
  .ui-refresh .card { margin: 0 10px 12px !important; padding: 19px 15px !important; border-radius: 14px !important; }
  .ui-refresh .row { gap: 9px !important; }
  .ui-refresh .row > .form-group { flex: 1 1 0 !important; width: auto !important; min-width: 0; }
  .ui-refresh .main-tabs .main-tab {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding-inline: 4px !important;
    font-size: 11px !important;
    white-space: nowrap;
  }
  .ui-refresh.ui-anzone #page-register > .card-title,
  .ui-refresh.ui-anzone #page-register > .row,
  .ui-refresh.ui-anzone #page-register > .form-group {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .council-hero { animation: hero-in .55s ease-out both; }
  .ui-refresh .card { animation: card-in .45s ease-out both; }
  @keyframes hero-in { from { opacity: 0; transform: translateY(10px); } }
  @keyframes card-in { from { opacity: 0; transform: translateY(7px); } }
}
