@font-face {
  font-family: "Warm Snow Sans";
  src: url("assets/fonts/NotoSansSC-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --f-brush: "Warm Snow Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #263a3b;
  --ink-2: #665740;
  --blue-ink: #284d59;
  --line: #e1d0ac;
  --red-d: #8a392b;
  --shimen-scene: url("assets/shimen/valley.webp");
  --warm-paper: #fffbef;
  --deep-teal: #15353e;
  --gold-line: #c5a96d;
}

body {
  background:
    linear-gradient(180deg, #e4eff497, #eaf1edee 68%, #e4ece6) fixed,
    var(--shimen-scene) 65% center / cover fixed,
    #e4ece6;
}
.top {
  background: var(--deep-teal);
  border-bottom: 1px solid var(--gold-line);
  padding-block: 12px;
}
.brand { text-decoration: none; flex: 0 0 auto; }
.brand b {
  color: #ffe7b6;
  background: none;
  filter: none;
  font-size: 25px;
  letter-spacing: .045em;
}
.brand small { color: #e9efe6; text-shadow: none; letter-spacing: 0; }
.shimen-preview {
  margin: 10px 0 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-ink);
}
:is(.page-head h1,.b-name,.empty h1,.hero-finale h1,.sky-cap span:first-child) {
  background: none;
  color: var(--deep-teal);
  filter: none;
  text-shadow: none;
  letter-spacing: .02em;
}
:is(.card,.stat,.peak-info,.ranks,.map-card,.cer-card,.fin-prize,.modal form) {
  background: var(--warm-paper);
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  box-shadow: 0 3px 8px #243d3920;
}
.card::before,.card::after,.map-card::before,.map-card::after { display: none; }
.card h2 {
  color: #83392c;
  padding: 0;
  margin: 0;
  clip-path: none;
  background: none;
  text-shadow: none;
  letter-spacing: .02em;
}
.gap {
  border: 1px solid #d7bc85;
  border-radius: 7px;
  background: #fff2d4;
  box-shadow: none;
}
.flag.ok { background: #247253; }
.flag.wait { background: #9b501f; }
:is(.hero-panel,.hero-finale,.empty,.found .preview) {
  border-radius: 12px;
  background:
    linear-gradient(90deg, #fff8e9 6%, #fff9eddf 48%, #e3f1f48a),
    var(--shimen-scene) 65% 52% / cover,
    #f4eee0;
  border: 1px solid var(--gold-line);
  box-shadow: none;
}
.hero-panel,.empty { padding: 24px; }
.hero-panel .banner { padding: 0 0 12px; }
.hero-finale p { color: var(--deep-teal); text-shadow: none; }
.sky {
  background: linear-gradient(#e0f0f3c9,#fffaf0ed), var(--shimen-scene) center 36% / cover, #e4edf2;
}
.primary {
  border-color: #865533;
  background: linear-gradient(#ffdaa0,#eab872);
  color: #472e1d;
}
.primary:hover:not(:disabled) { filter: brightness(1.06); }
.tab:hover:not([aria-current]),.tier-list button:hover,.ranks .row:hover { filter: brightness(1.04); }
button:focus-visible,a:focus-visible { outline: 3px solid #b85b23; outline-offset: 3px; }

.totem { border-color: #d7b573; box-shadow: 0 0 0 1px #765b42, 0 3px 7px #23383544; }
.totem i { z-index: 1; background: color-mix(in srgb,var(--c) 55%,#182534); }
.totem-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  visibility: hidden;
}
.totem-art.ready { visibility: visible; }
.totem:has(.totem-art.ready)>span { visibility: hidden; }
.totem-grid .tg {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  padding: 9px 3px;
  min-width: 0;
}
.totem-grid .tg>.totem { width: min(44px,100%); height: auto; aspect-ratio: 1; }
.totem-grid .tg>span { font-size: 12px; }

.building-art,.lamp-art { display: inline-grid; place-items: center; }
.building-art>* ,.lamp-art>* { grid-area: 1/1; }
.building-art img,.lamp-art img { visibility: hidden; object-fit: contain; }
.building-art img { object-position: center bottom; }
.building-art img.ready,.lamp-art img.ready { visibility: visible; }
:is(.building-art,.lamp-art):has(img.ready) svg { visibility: hidden; }
.sect:hover .bld { transform: translateY(-2px) scale(1.04); }
.lamp-art img { width: 40px; height: 60px; filter: grayscale(.85) brightness(.88); }
.lamp.lit .lamp-art img { filter: drop-shadow(0 0 9px #f39c4244); }
.lamp.just .lamp-art img { animation: ignite 1.1s ease-out; }
.lamp.ghost .lamp-art img { opacity: .55; }
.cer-lamps .lamp-art img { width: 54px; height: 81px; }
.cer-card :is(p,small) { color: var(--ink); }

@media (min-width:900px) {
  .top { gap: clamp(8px,1.3vw,20px); }
  .tabs { gap: clamp(4px,.8vw,12px); }
  .tab { padding-right: clamp(5px,1vw,14px); }
  .tab b { width: 36px; height: 36px; }
  .hero-panel .banner { padding: 0; }
  .lamp-art img { width: 52px; height: 78px; }
}
@media (min-width:1680px) {
  .app { max-width: 1520px; }
}
@media (max-width:420px) {
  .brand b { font-size: 22px; }
  .top .chip-btn { padding-inline: 7px; }
  .hero-panel,.empty { padding: 16px; }
}
@media (max-width:360px) {
  .top { gap: 6px; padding-inline: 10px; }
  .brand b { font-size: 20px; }
}

.legend .building-art { display: inline-grid; }
.totem-grid .tg {
  aspect-ratio: auto;
  border-radius: 8px;
  color: var(--deep-teal);
}
.totem-grid .tg[aria-pressed="true"] {
  background: #f7e8c5;
  color: var(--deep-teal);
  border-color: #835e31;
  text-shadow: none;
}
.fin-name {
  color: #ffe0a5;
  background: none;
  filter: none;
  text-shadow: 0 2px 3px #162533;
}

.hero-finale { padding: 24px 12px; }
@media (min-width:900px) {
  .tab:not([aria-current]) {
    color: #f5e7ce;
    background: #254952;
    border-color: #718587;
  }
  .tab:not([aria-current]) span { color: inherit; }
  .tab:hover:not([aria-current]) { background: #315862; }
}

#snow { opacity: .52; }

@media (min-width:900px) {
  .world-wrap,.world-wrap.has-note {
    height: calc(100dvh - 130px);
    border-radius: 12px;
    box-shadow: 0 0 0 1px #87623b, 0 4px 8px #24494b26;
  }
  .wall-side { max-height: calc(100dvh - 130px); }
}

.demo-arena-field { margin-top: 16px; }
.demo-arena-field select,
.wall-map-arena select {
  width: 100%;
  min-height: 40px;
  padding: 5px 10px;
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  background: var(--warm-paper);
  color: var(--ink);
  font: inherit;
}
.wall-map-options { display: grid; gap: 10px; }
.wall-map-depts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.wall-map-depts .chip {
  min-height: 42px;
  padding: 6px 8px;
  border-color: var(--gold-line);
  color: var(--deep-teal);
  background: var(--warm-paper);
  font-size: 14px;
}
.wall-map-depts .chip:hover { background: #f7ead0; }
.wall-map-depts .chip[aria-pressed="true"] {
  border-color: var(--deep-teal);
  color: var(--warm-paper);
  background: var(--deep-teal);
}
.wall-map-arena {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--deep-teal);
}
.wall-map-arena label { font-size: 13px; font-weight: 800; }
.wall-map-arena select { font-size: 16px; }
.random-match {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #9eaea4;
  border-radius: 10px;
  background: #f2f6ed;
  color: var(--deep-teal);
}
.random-match header,
.match-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.random-match h2 { margin: 0; font-size: 18px; }
.random-match header span,
.match-progress span { font-size: 12px; font-weight: 750; }
.match-status { margin: 0; font-size: 13px; line-height: 1.55; }
.match-progress progress {
  width: 45%;
  height: 9px;
  accent-color: var(--deep-teal);
}
.match-actions,
.match-sim,
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.match-actions .primary { padding: 7px 14px; font-size: 14px; }
.match-actions .primary:disabled { opacity: .55; cursor: not-allowed; }
.match-sim { flex-basis: 100%; padding-top: 6px; border-top: 1px solid #b7c9bb; }
.match-sim span { margin-right: 2px; font-size: 12px; font-weight: 750; }
.match-sim .sm-btn { min-height: 36px; }
.match-exit {
  padding: 5px;
  border: 0;
  background: none;
  color: var(--deep-teal);
  text-decoration: underline;
  cursor: pointer;
}
.match-exit:disabled { opacity: .55; cursor: not-allowed; }
.welcome-opt-in {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 0;
  color: var(--deep-teal);
}
.welcome-opt-in input { margin: 4px 0 0; accent-color: var(--deep-teal); }
.welcome-opt-in small { display: block; margin-top: 4px; line-height: 1.5; }
.welcome-seat p { margin: 5px 0 10px; }
.welcome-actions:empty { display: none; }
.match-mentor { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.match-mentor p { margin: 3px 0 0; }
.welcome-joined { margin: 5px 0 0; color: var(--deep-teal); font-size: 13px; font-weight: 780; }
.wall-search { display: grid; gap: 6px; }
.wall-search label { color: var(--deep-teal); font-size: 13px; font-weight: 800; }
.wall-search input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #a48553;
  border-radius: 8px;
  background: var(--warm-paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.wall-search input::placeholder { color: var(--ink-2); }
.wall-search-results {
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  background: var(--warm-paper);
}
.wall-search-note { margin: 0; padding: 8px 10px; color: var(--ink-2); font-size: 12px; }
.wall-search-results ul {
  max-height: 216px;
  overflow: auto;
  list-style: none;
  padding: 0 4px 4px;
  margin: 0;
}
.wall-search-results button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--deep-teal);
  text-align: left;
  cursor: pointer;
}
.wall-search-results button span { color: var(--ink-2); font-size: 12px; }
.wall-search-results button:hover,.wall-search-results button:focus-visible { background: #f7ead0; }
.wall-search-results button:focus-visible { outline-offset: -3px; }
@media (min-width:900px) {
  .range-side .ap-group .chips {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .range-side .chip { padding: 6px 4px; text-align: center; font-size: 12px; }
}
