@font-face {
  font-family: Nunito;
  src: url("Nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("CormorantGaramond.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: Explora;
  src: url("Explora.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Roboto;
  src: url("Roboto.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Roboto;
  src: url("Roboto-Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: Nunito, Roboto, sans-serif;
  color: #f4ece2;
  background: #161518;
  --muted: #c7b9ad;
  --gold: #f7ca8c;
  --border: #574436;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  cursor: default;
  background: radial-gradient(ellipse at 82% 0%, #3b2922, transparent 62%);
}
.wrap { width: min(100% - 2rem, 86rem); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--border); font-weight: 650; }
.masthead .wrap { padding-block: 1rem; }
.masthead span { color: var(--gold); margin-right: .4rem; }
main { padding-block: clamp(2rem, 7vw, 4.5rem); }
/* Match the original typeface for headings and navigation labels. */
:where(h1, h2, h3, h4, h5, h6, legend, nav, [role="tab"], #show-stories, #show-notices,
  .notice-compose > summary, .notice-archive > summary, .story-compose > summary,
  #story-reports > summary, #hidden-stories > summary, .masthead .brand) {
  font-family: Roboto, sans-serif;
}
h1 { font: 600 clamp(2.65rem, 7vw, 4.5rem)/1 Roboto, sans-serif; margin: 0; }
.intro { color: var(--muted); margin: 1rem 0 2.5rem; }
.legions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
fieldset, .planner-panel {
  min-width: 0;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: .8rem;
  background: #211c1d;
}
legend { padding-inline: .5rem; color: var(--gold); font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
label { display: grid; gap: .45rem; font-size: .9rem; color: var(--muted); }
input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: .4rem;
  padding: .65rem .55rem;
  background: #171518;
  color: inherit;
  font: inherit;
}
a { color: var(--gold); text-underline-offset: .2em; }
a[href], summary, [role="button"], input:is([type="submit"], [type="button"], [type="reset"]):enabled { cursor: pointer; }
textarea:not([readonly], :disabled),
input:not([readonly], :disabled):is(:not([type]), [type="text"], [type="password"], [type="search"], [type="email"], [type="url"], [type="tel"], [type="number"]),
[contenteditable]:not([contenteditable="false"]) { cursor: text; }
.planner-link, .back { display: inline-block; }
.planner-link { margin-top: 1.1rem; }
.back { margin-bottom: 1.4rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1.5rem; }
button {
  background: var(--gold);
  color: #291b12;
  border: 0;
  border-radius: .45rem;
  padding: .7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#save-status, .planner-panel p { color: var(--muted); margin: 0; }
.planner-panel h2 { margin: 0 0 .6rem; font-size: 1.2rem; }
@media (max-width: 46rem) { .legions { grid-template-columns: 1fr; } }
@media (max-width: 23rem) { .fields { grid-template-columns: 1fr; } }

#roster-summary, #roster-message, #ocr-local-help { margin-top: 1rem; }
#roster-upload { max-width: 100%; }
.roster-table { overflow-x: auto; margin-top: 1rem; }
.roster-table table { width: 100%; min-width: 38rem; border-collapse: collapse; }
.roster-table th, .roster-table td { text-align: left; padding: .55rem; border-bottom: 1px solid var(--border); }
.roster-table td:first-child { min-width: 10rem; }
.roster-table td:nth-child(2) { width: 8rem; }
.roster-table td:nth-child(4) { color: var(--muted); font-size: .9rem; min-width: 9rem; }
.roster-table select { padding: .55rem; border: 1px solid var(--border); border-radius: .4rem; font: inherit; }
.roster-table button, #roster-add { background: transparent; color: var(--gold); border: 1px solid var(--border); }
button:disabled { opacity: .55; cursor: default; }


.brand { text-decoration: none; color: inherit; }
.masthead-inner, .masthead nav { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; }
.masthead-inner { justify-content: space-between; }
.masthead nav a { text-decoration: none; padding-block: .25rem; }
.masthead nav a[aria-current] { text-decoration: underline; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.home-grid article > a,
.bear-event-card > a { display: inline-block; margin-top: .85rem; }

.chat-launcher { position: fixed; right: 1rem; bottom: 1rem; padding: .65rem .9rem; background: #2a201c; border: 1px solid var(--border); border-radius: 1.3rem; text-decoration: none; }
main.wrap { width: min(100% - 2rem, 80%, 79rem); padding-bottom: max(4.5rem, env(safe-area-inset-bottom)); }
@media (min-width: 61rem) {
  #events { width: calc(100% - 3rem); margin-inline: auto; }
  #maintenance { width: min(100%, calc(100vw - 23rem)); margin-inline: auto; }
}
@media (max-width: 46rem) { .home-grid { grid-template-columns: 1fr; } }


#assignment-panel { margin-top: 1rem; }
#assignment-panel fieldset { margin-top: 1rem; }
#assignment-message { margin-top: .9rem; }
.building-choice, .assignment-team li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; justify-content: space-between; }
.building-choice + .building-choice { margin-top: .65rem; }
.building-choice label { display: flex; align-items: center; }
.building-choice input { width: auto; accent-color: var(--gold); }
#assignment-panel select { max-width: 100%; padding: .45rem; font: inherit; }
.assignment-team { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.assignment-team h3 { margin: 0 0 .35rem; }
.assignment-team ul { padding: 0; list-style: none; }
.assignment-team li + li { margin-top: .4rem; }

#noticeboard-entries { list-style: none; padding: 0; margin: 0; }
#noticeboard-entries li + li { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
#noticeboard-entries p { margin: .35rem 0; }
.published-team + .published-team { margin-top: 1rem; }
.published-team ul { padding-left: 1.2rem; margin-bottom: 0; }


.tri-panel { margin-top: 1.5rem; }
.tri-status { margin-top: 1rem; }
.tri-teams select { max-width: 100%; padding: .45rem; font: inherit; }

.tri-legion-nav { display: flex; gap: 1rem; margin-top: 1.5rem; }
.tri-legion-nav [aria-current] { font-weight: 700; }
.account-panel { margin-top: 1.25rem; }
.account-auth { max-width: 28rem; }
.account-auth label + label { margin-top: .85rem; }
.account-panel select, .account-actions select {
  padding: .6rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  font: inherit;
}
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.account-panel p[role="status"]:not(:empty), #reset-status:not(:empty) { margin-top: .85rem; }
#reset-access { width: min(calc(100% - 2rem), 30rem); }
#reset-access::backdrop { background: rgb(0 0 0 / .65); }
.profile-identity { display: flex; align-items: center; gap: .9rem; margin-top: 1.25rem; }
.profile-identity p { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.profile-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #2a201c;
  color: var(--gold);
  font-size: 1.25rem;
  font-weight: 700;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
#avatar-file { max-width: 28rem; }
#avatar-help { margin-top: .55rem; font-size: .9rem; }
@media (max-width: 60rem) { main.wrap { width: calc(100% - 2rem); } }
.chat-launcher, .chat-panel { z-index: 2; }
.chat-launcher { color: var(--gold); }
.chat-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  width: min(25rem, calc(100vw - 2rem));
  height: min(32rem, calc(100dvh - 2rem));
  border: 1px solid var(--border);
  border-radius: .85rem;
  background: #211c1d;
  box-shadow: 0 .6rem 2.5rem #0008;
}
.chat-header, .chat-compose { display: flex; align-items: center; gap: .6rem; }
.chat-header { justify-content: space-between; padding: .65rem .8rem .5rem; }
.chat-header h2 { font-size: 1.13rem; margin: 0; }
.chat-icon { background: transparent; color: var(--gold); font-size: 1.2rem; padding: .35rem .55rem; }
.chat-presence { border-block: 1px solid var(--border); }
.chat-presence summary { padding: .55rem .8rem; cursor: pointer; color: var(--muted); font-size: .875rem; }
.chat-dot { display: inline-block; width: .48rem; height: .48rem; border-radius: 50%; background: #8ad7a5; }
#chat-online { list-style: none; padding: 0 .8rem .55rem; margin: 0; overflow: auto; max-height: min(7rem, 20dvh); }
#chat-online li { display: flex; align-items: center; gap: .5rem; padding-block: .2rem; font-size: .88rem; }
.chat-history { position: relative; overflow: auto; padding: .75rem .8rem; }
#chat-empty { color: var(--muted); }
#chat-messages { list-style: none; padding: 0; margin: 0; }
#chat-messages li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .55rem; margin-bottom: .85rem; }
#chat-messages p { margin: .2rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .55rem; }
.chat-meta time { color: var(--muted); font-size: .74rem; }
.chat-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  border-radius: 50%;
  background: #382822;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 700;
}
.chat-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#chat-online .chat-avatar { width: 1.4rem; height: 1.4rem; font-size: .58rem; }
.chat-status { margin: 0; padding: 0 .8rem; color: var(--gold); font-size: .85rem; }
#chat-form { border-top: 1px solid var(--border); padding: .65rem; }
.chat-compose input { flex: 1; }
.chat-emoji { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .15rem; margin-bottom: .4rem; max-height: min(9rem, 25dvh); overflow-y: auto; }
.chat-emoji button { background: transparent; color: inherit; font-size: 1.15rem; padding: .3rem 0; }
.chat-emoji button:hover, .chat-icon:hover { background: #382822; }
.chat-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  padding-left: .55rem;
  margin-bottom: .4rem;
  border-left: 2px solid var(--gold);
  color: var(--muted);
  font-size: .8rem;
}
.chat-context > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-context .chat-icon { flex: none; padding-block: .15rem; }
.chat-reply-button { color: var(--gold); background: transparent; font-size: .75rem; padding: .12rem .2rem; }
.chat-quote { margin: .25rem 0; padding: .2rem .5rem; border-left: 2px solid var(--border); color: var(--muted); overflow-wrap: anywhere; font-size: .83rem; }
.chat-quote strong { display: block; }
.chat-file-link { display: block; margin-top: .25rem; overflow-wrap: anywhere; font-size: .86rem; }
.chat-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; max-height: min(7rem, 20dvh); overflow: auto; }
.chat-tags button { background: #382822; color: var(--gold); padding: .25rem .4rem; font-size: .8rem; overflow-wrap: anywhere; }
.chat-tag { color: var(--gold); font-weight: 700; }
.chat-tag-self { background: #523b29; border-radius: .2rem; }
.chat-compose { gap: .35rem; }
#chat-attach { padding-inline: .35rem; }
.chat-launcher, .chat-header-actions { display: flex; align-items: center; gap: .35rem; }
.chat-header-actions { margin-left: auto; }
#chat-clear-open { display: inline-grid; place-items: center; }
#chat-clear-dialog { width: min(calc(100% - 2rem), 22rem); }
.chat-badge {
  flex: none;
  border: 1px solid #88643d;
  border-radius: 1rem;
  padding: .15rem .45rem;
  background: #473222;
  color: #ffdaaa;
  font-size: .72rem;
  white-space: nowrap;
}
.chat-mention-badge { background: #622e43; color: #ffe2ec; border-color: #ad617e; }
.chat-first-unread::before {
  content: "New messages";
  grid-column: 1 / -1;
  border-top: 1px solid #88643d;
  padding-top: .35rem;
  color: var(--gold);
  font-size: .75rem;
}
#chat-messages .chat-jump-target { outline: 1px solid var(--gold); outline-offset: 3px; border-radius: .25rem; }
.chat-quote { display: block; width: 100%; background: #2a2020; text-align: left; font-weight: 400; border-radius: .15rem; }
.chat-quote:hover:not(:disabled) { background: #382822; color: var(--gold); }
.chat-quote:disabled { opacity: .75; }
#chat-attach svg { display: block; }
body {
  background:
    radial-gradient(ellipse at 0 0, #432136 0, transparent 43rem),
    radial-gradient(ellipse at 100% 5%, #3f2920 0, transparent 42rem),
    #17151b;
}
.masthead { background: rgb(28 20 32 / .8); }
.masthead .brand { display: inline-flex; align-items: center; gap: .28rem; font-size: 1.15rem; font-weight: 800; white-space: nowrap; }
.masthead .brand span { margin: 0; }
.masthead .brand .brand-mark {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: .24rem;
  background: #69344d;
  color: #ffe1ab;
  border-radius: .65rem;
  transform: rotate(-9deg);
  box-shadow: 0 .2rem 0 #341823;
  transition: transform .22s ease;
}
.brand:hover .brand-mark { transform: rotate(8deg) scale(1.08); }
.masthead .brand .brand-dot { color: #f5b5c7; }
.masthead .brand .brand-fun {
  padding: .1rem .32rem;
  border-radius: .4rem;
  background: #f5b5c7;
  color: #4b2337;
  font-size: .9rem;
  letter-spacing: .06em;
  transform: rotate(5deg);
}
.masthead nav { gap: .35rem .75rem; }
.masthead nav a {
  position: relative;
  display: inline-block;
  padding: .6rem .85rem;
  white-space: nowrap;
  text-decoration: none;
}
.masthead nav a::before, .masthead nav a::after {
  content: "";
  position: absolute;
  pointer-events: none;
  color: #b48a78;
  transition: color .18s ease, transform .18s ease;
}
.masthead nav a::before { inset: .26rem 0; border-block: 2px solid currentColor; }
.masthead nav a::after { inset: 0 .25rem; border-inline: 2px solid currentColor; }
.masthead nav a:is(:hover, :focus-visible, [aria-current])::before,
.masthead nav a:is(:hover, :focus-visible, [aria-current])::after { color: var(--gold); }
.masthead nav a:is(:hover, :focus-visible)::before { transform: scaleX(1.04); }
.masthead nav a:is(:hover, :focus-visible)::after { transform: scaleY(1.1); }
.masthead nav a[aria-current] { color: #fff0d8; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  .masthead nav a::before, .masthead nav a::after { transition: none; transform: none !important; }
}
.account-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.account-tools #account-logout { padding: .5rem .72rem; background: #382a38; color: #ffd8df; }
.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  padding: .34rem .55rem;
  border: 1px solid #3b6753;
  border-radius: 2rem;
  background: #223c33;
  font-size: .79rem;
  white-space: nowrap;
}
.masthead .online-indicator > span { width: .48rem; height: .48rem; margin: 0; border-radius: 50%; background: #99e5b8; }
.online-indicator strong { color: #c2f2d4; }
.masthead .masthead-avatar { width: 40px; height: 40px; position: relative; border-color: #b66b85; font-size: .84rem; text-decoration: none; }
.masthead .masthead-avatar span { margin: 0; color: #ffdbeb; }
.masthead .masthead-avatar img { position: absolute; inset: 0; }
.masthead-avatar:hover { box-shadow: 0 0 0 3px #a55c7955; }
.account-panel select, .player-entry select { width: 100%; min-width: 0; }
.account-actions select { width: auto; }
#accounts-table :is(th, td):nth-child(4) { min-inline-size: 6.5rem; }
#accounts-table :is(th, td):nth-child(5) { padding-inline-start: .35rem; }
#accounts-table :is(th, td):last-child {
  min-inline-size: 14rem;
  padding-inline-start: 1.25rem;
  border-inline-start: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}
#accounts-table .account-actions { justify-content: center; }
#accounts-table tbody :is(button, select) { font-size: calc(1em - 2px); }
#accounts-table :is(th, td):first-child { white-space: nowrap; }
#accounts-table .account-role-actions { flex-wrap: nowrap; }
#accounts-table .account-role-actions select {
  inline-size: 6.65rem;
  text-align: center;
  text-align-last: center;
}
#accounts-table .account-role-actions button { inline-size: 6.25rem; }
.account-self {
  display: inline-block;
  margin-inline-start: .5rem;
  padding: .15rem .4rem;
  border-radius: .3rem;
  background: #362737;
  color: var(--muted);
  font-size: .75rem;
  vertical-align: middle;
}
.player-entry { background: linear-gradient(145deg, #372637, #211c24 76%); border-color: #714761; }
.player-entry h2 { color: #ffd2df; }
.player-entry .fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.player-entry fieldset, .player-entry #player-linked { margin-top: 1rem; }
.player-entry fieldset { border-color: #714761; }
.password-hint, .planner-panel .password-hint { margin-top: .55rem; color: var(--muted); font-size: .83rem; }
.published-events { display: grid; gap: .45rem; list-style: none; padding: 0; margin: .65rem 0 0; }
.published-events:empty { display: none; }
.published-events a {
  display: block;
  padding: .6rem .75rem;
  border: 1px solid #694660;
  border-radius: .55rem;
  background: #362636;
  text-decoration: none;
  transition: background .18s ease;
}
.published-events a:hover { background: #4b2e45; }
.arrival-toast { position: fixed; z-index: 4; top: 1rem; right: 1rem; width: max-content; max-width: calc(100% - 2rem); pointer-events: none; }
.arrival-card {
  padding: .8rem 1.05rem;
  border: 1px solid #f7aec8;
  border-radius: 1rem .85rem 1rem 1rem;
  background: #71324e;
  color: #fff1f5;
  box-shadow: 0 .5rem 1.75rem #180e1e99;
  font-weight: 750;
  overflow-wrap: anywhere;
  animation: arrival 3s both;
}
.chat-panel:not([hidden]) {
  border-color: #9a5876;
  transform-origin: bottom right;
  animation: chat-open .28s cubic-bezier(.2,.8,.25,1.1) both;
}
.chat-launcher { border-color: #9a5876; background: #422838; transition: transform .2s ease, background .2s ease; }
.chat-launcher:hover { transform: translateY(-3px); background: #542f47; }
main.wrap > section:not([hidden]) { animation: reveal-page .22s ease-out both; }
@keyframes arrival {
  0% { opacity: 0; transform: translateY(-11px) rotate(3deg) scale(.94); }
  10%, 90% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-7px); }
}
@keyframes chat-open {
  from { opacity: 0; transform: translate(6px, 15px) scale(.93); }
  to { opacity: 1; transform: none; }
}
@keyframes reveal-page {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 42rem) {
  .masthead nav { order: 3; width: 100%; padding-top: .25rem; }
  .arrival-toast { top: .65rem; right: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  .brand .brand-mark, .masthead nav a, .published-events a, .chat-launcher { transition: none; }
  .arrival-card, .chat-panel:not([hidden]), main.wrap > section:not([hidden]) { animation: none; }
  .chat-launcher:hover { transform: none; }
}
.masthead .brand .brand-fun { font-size: 1.12rem; font-weight: 900; padding: .08rem .37rem; }
body { isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: -3%;
  z-index: -3;
  pointer-events: none;
  background: url("alliance-backdrop.jpg") center 58% / cover no-repeat;
  opacity: .17;
  transform-origin: 58% 64%;
  animation: alliance-backdrop 34s ease-in-out infinite alternate;
}
@keyframes alliance-backdrop {
  from { transform: scale(1) translateX(-.45%); }
  to { transform: scale(1.045) translateX(.45%); }
}
.friends-count { color: var(--muted); font-size: .85rem; margin-left: .2rem; }
.friend-dot { display: inline-block; width: .56rem; height: .56rem; border-radius: 50%; background: #a391a0; margin-right: .15rem; }
.friend-dot-idle { background: #f4cc79; }
.friend-dot-online { background: #99e5b8; box-shadow: 0 0 .6rem #99e5b855; }
.friends-list { list-style: none; padding: 0; margin: 0; }
.friends-list li { display: flex; gap: .65rem; align-items: center; padding: .55rem 0; overflow-wrap: anywhere; }
.friends-list li + li { border-top: 1px solid var(--border); }
.friends-list strong, .friends-list small { display: block; }
.friends-list small { color: var(--muted); }
.friends-list .profile-avatar { position: relative; width: 2.2rem; height: 2.2rem; font-size: .78rem; }
.friends-list img { position: absolute; inset: 0; }
#player-table table { min-width: 69rem; }
#player-table.player-table-simple table { min-width: 41rem; }
#player-table td:first-child { min-width: 3rem; }
#player-table td[data-field="name"] { min-width: 9rem; }
.player-roster-grid [data-field="gameId"] { min-width: 12rem; padding-inline: .85rem; }
.player-roster-grid th { text-align: center; }
.player-roster-grid td { text-align: left; }
.player-roster-grid th + th, .player-roster-grid td + td { border-inline-start: 1px solid var(--border); }
#player-table td:nth-child(4) { color: inherit; }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
:root { --header-gutter: clamp(1rem, 2.5vw, 3rem); }
.masthead .masthead-inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  width: calc(100% - 2 * var(--header-gutter));
  gap: .65rem 1rem;
}
.masthead nav { grid-column: 2; justify-content: center; }
.account-tools { grid-column: 3; justify-self: end; justify-content: flex-end; }
.arrival-toast { top: calc(var(--masthead-height, 4.5rem) + 2rem); right: var(--header-gutter); }
@media (max-width: 58rem) {
  .masthead .masthead-inner { grid-template-columns: minmax(0, 1fr) max-content; }
  .account-tools { grid-column: 2; grid-row: 1; }
  .masthead nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .arrival-toast { top: calc(var(--masthead-height, 6.5rem) + .85rem); }
}
@media (max-width: 25rem) {
  .masthead .masthead-inner { grid-template-columns: minmax(0, 1fr); }
  .account-tools { grid-column: 1; grid-row: 2; }
  .masthead nav { grid-row: 3; }
}
.player-filters { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; margin-top: .9rem; }
.player-filters button { background: #362936; color: var(--gold); padding: .65rem .75rem; }
.player-table-summary { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.planner-panel .player-count { margin: 0; font-size: .86rem; }
#player-list-status { margin-top: .4rem; }
#player-list-status:empty, #history-status:empty { display: none; }
.maintenance-scroll {
  --player-row: 2.75rem;
  max-block-size: min(calc(11 * var(--player-row)), 65vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: .5rem;
}
@media screen {
  :is(#player-rows, #user-rows) tr.is-highlighted > td {
    background-color: #51384c;
    box-shadow: inset 0 1px #ad7a91, inset 0 -1px #ad7a91;
  }
}
.maintenance-scroll thead th { position: sticky; top: 0; z-index: 1; background: #362737; box-shadow: 0 1px var(--border); }
#player-table th, #player-table td { height: var(--player-row); padding-block: .35rem; white-space: nowrap; }
#player-table td[data-field="name"] { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
#player-table td[data-field="remarks"] { min-width: 10rem; max-width: 26rem; white-space: normal; overflow-wrap: anywhere; }
.player-row-actions { display: flex; gap: .4rem; }
#player-table button { padding: .35rem .55rem; }
#player-table .row-remove { color: #ffb8c6; }
#player-table .row-remove:hover, .danger-button { color: #fff1f5; background: #79344d; }
#member-history summary { cursor: pointer; font-weight: 700; }
#member-history[open] summary { margin-bottom: .75rem; }
#history-table td { vertical-align: top; overflow-wrap: anywhere; }
#history-table { max-block-size: 19rem; }
.maintenance-dialog { width: min(calc(100% - 2rem), 32rem); }
.maintenance-dialog::backdrop { background: rgb(0 0 0 / .65); }
.maintenance-dialog textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: .4rem;
  padding: .65rem;
  background: #171518;
  color: inherit;
  font: inherit;
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 28rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.8rem, 4vw, 5rem);
  min-height: min(33rem, 65vh);
}
.welcome-scene {
  display: grid;
  grid-template-areas: "welcome";
  place-items: center;
  width: min(100%, 49rem);
  justify-self: center;
}
.welcome-scene img {
  grid-area: welcome;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 .45rem 1rem #1b0f1a80);
}
.welcome-title {
  grid-area: welcome;
  z-index: 1;
  display: grid;
  gap: .08em;
  justify-items: center;
  margin: 0 0 5%;
  color: #ffdfbc;
  text-align: center;
  font: italic 600 clamp(1.65rem, 3.7vw, 3.35rem)/1 Roboto, sans-serif;
  text-shadow: 0 .12em .22em #160e17, 0 0 .6em #d1789b76;
}
.welcome-title strong {
  font: 800 clamp(3.05rem, 6.9vw, 6.4rem)/.98 Roboto, sans-serif;
  color: #ffe5bc;
  letter-spacing: .075em;
  padding-left: .075em;
}
@media (max-width: 53rem) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); justify-items: center; min-height: 0; gap: 1.45rem; }
  .auth-entry { width: min(100%, 28rem); }
  .welcome-scene { max-width: 32rem; }
}
.snowfall { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.snowfall span {
  position: absolute;
  top: -2rem;
  left: var(--x);
  color: #fff1fc;
  opacity: .38;
  font: var(--size)/1 Roboto, "Segoe UI Symbol", sans-serif;
  text-shadow: 0 0 .4em #ffe1f088;
  animation: snowflake-fall var(--fall) var(--delay) linear infinite;
}
.snowfall span:nth-child(3n) { opacity: .24; }
.snowfall span:nth-child(4n) { color: #ffe4bb; }
@keyframes snowflake-fall {
  from { transform: translate3d(0, -1rem, 0) rotate(0); }
  to { transform: translate3d(var(--drift), calc(100vh + 3rem), 0) rotate(115deg); }
}
@media (prefers-reduced-motion: reduce) {
  .snowfall span { animation: none; top: var(--y); }
}
#published-actions { margin: -1rem 0 1.25rem; }
.strategy-edit { border: 1px solid var(--border); border-radius: .45rem; padding: .65rem .85rem; font-weight: 700; text-decoration: none; }
.strategy-edit:hover { background: #382737; }
#published-status { color: var(--muted); }
#published-status:empty { display: none; }
.emoji-toggle, #chat-attach { display: grid; place-items: center; flex: none; padding: .35rem; min-width: 2rem; min-height: 2.15rem; }
.emoji-toggle svg { display: block; }
.notice-compose { align-self: start; }
.notice-compose > summary, .story-compose > summary { cursor: pointer; font-size: 1.125rem; font-weight: 700; }
.notice-compose[open] > summary, .story-compose[open] > summary { margin-bottom: .75rem; }
.notice-compose textarea, .story-compose textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: .4rem;
  padding: .65rem;
  background: #171518;
  color: inherit;
  font: inherit;
}
.notice-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.notice-image-upload { flex: 1; min-width: 12rem; }
.notice-image-upload input { padding: .35rem; }
.notice-compose .actions, .story-compose .actions { margin-top: .7rem; }
#notice-status:not(:empty), #story-status:not(:empty) { margin-top: .7rem; }
.publish-confirmation:not(:empty) {
  width: fit-content;
  padding: .45rem .65rem;
  border: 1px solid #8e7249;
  border-radius: .5rem;
  background: #3b2c1c;
  color: #ffe7bd;
  font-weight: 650;
  animation: publish-confirmation-in .24s ease-out both;
}
@keyframes publish-confirmation-in {
  from { opacity: 0; transform: translateY(.2rem); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .publish-confirmation:not(:empty) { animation: none; }
}

.noticeboard-scrollable { max-block-size: min(38rem, 65vh); overflow: auto; padding-right: .65rem; }
.alliance-notice time { margin-left: .55rem; color: var(--muted); font-size: .8rem; }
.alliance-notice p { white-space: pre-wrap; overflow-wrap: anywhere; }
.alliance-notice img { display: block; max-width: 100%; max-height: 18rem; margin-top: .6rem; object-fit: contain; border-radius: .5rem; }
.notice-toast { background: #624264; border-color: #f9c69a; }
#suspension-review-status:empty { display: none; }
#suspension-review-table td:nth-child(3) { overflow-wrap: anywhere; }
:is(.home-hero, #events, #friends, #maintenance, #profile, #notifications) > h1 {
  font-family: Explora, Roboto, sans-serif;
  font-weight: 700;
  font-size: clamp(3.35rem, 7vw, 6.15rem);
  line-height: 1.12;
  color: #ffd7e6;
  -webkit-text-stroke: .65px currentColor;
  text-shadow: 0 .065em .24em #a13d75a8;
}
.alliance-feeds { align-items: start; gap: clamp(1rem, 2.5vw, 2rem); }
#home { --feed-width: 48rem; }
.alliance-feed { display: grid; min-width: 0; width: min(100%, var(--feed-width)); gap: 1rem; }
.story-compose, .story-board { background: #2c263b; border-color: #685287; }
.story-compose > summary, .story-board h2 { color: #ead6ff; }
.story-compose button[type="submit"] { color: #2c1744; background: #d9bbf4; }
.story-compose button[type="submit"]:hover { background: #ebd7ff; }
.story-compose textarea { background: #201a2b; border-color: #685287; }
#stories-entries { display: grid; gap: .7rem; list-style: none; margin: 0; padding: 0; }
.stories-scrollable { max-block-size: min(38rem, 68vh); overflow: auto; padding-right: .5rem; }
.story-card { padding: .75rem .85rem; border: 1px solid #58466f; border-radius: 1rem; background: #362b49; }
.story-card header { display: flex; align-items: baseline; flex-wrap: wrap; gap: .18rem .55rem; }
.story-card strong { color: #f2e6ff; overflow-wrap: anywhere; }
.story-card time { color: #d0bbdf; font-size: .76rem; }
.story-card > p { font-size: calc(1em + 3px); font-weight: 700; }
.story-card p { margin: .4rem 0 0; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.story-card img { display: block; max-width: 100%; max-height: 18rem; margin-top: .55rem; object-fit: contain; border-radius: .75rem; }
.story-reactions { display: flex; gap: .42rem; margin-top: .63rem; }
.story-reactions button { padding: .19rem .55rem; border-radius: 1rem; color: #f6eaff; background: #47385e; font-size: .83rem; }
.story-reactions button:hover { background: #594577; }
.story-reactions button[aria-pressed="true"] { background: #d9bbf4; color: #2c1744; }
#stories-status:empty { display: none; }
.cursor-sparkle-layer { position: fixed; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.cursor-sparkle {
  position: absolute;
  color: var(--spark-color);
  font-size: var(--spark-size);
  line-height: 1;
  text-shadow: 0 0 .45em currentColor;
  animation: cursor-sparkle .95s ease-out both;
}
.click-sparkle {
  position: fixed;
  z-index: 6;
  pointer-events: none;
  text-shadow: 0 0 .22em #fff5df, 0 0 .55em currentColor;
  animation: click-sparkle .78s ease-out both;
}
@keyframes click-sparkle {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.55); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(.5) rotate(105deg); }
}
@keyframes cursor-sparkle {
  from { opacity: .88; transform: translate(-50%, -50%) scale(1) rotate(0); }
  to { opacity: 0; transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(.25) rotate(55deg); }
}
@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  .cursor-sparkle-layer { display: none; }
}
:is(.home-hero, #events, #friends, #maintenance, #profile, #notifications) > h1::before,
:is(.home-hero, #events, #friends, #maintenance, #profile, #notifications) > h1::after {
  color: #f6b4d2;
  font: .33em/1 Roboto, sans-serif;
  -webkit-text-stroke: 0;
  text-shadow: 0 0 .6em #f191c1;
  vertical-align: middle;
}
:is(.home-hero, #events, #friends, #maintenance, #profile, #notifications) > h1::before { content: "❧ ✧" / ""; margin-right: .28em; }
:is(.home-hero, #events, #friends, #maintenance, #profile, #notifications) > h1::after { content: "✧ ☙" / ""; margin-left: .28em; }
.story-tools { display: flex; flex-wrap: wrap; gap: .28rem; margin-left: auto; }
.story-tools button, .story-report-actions button {
  background: transparent;
  color: #e6c8f7;
  padding: .18rem .38rem;
  font-size: .77rem;
}
.story-tools button:hover, .story-report-actions button:hover { background: #56426e; }
.story-tools .story-delete, .story-report-actions .story-delete { color: #ffc1cb; }
.story-comments { max-width: 42rem; margin-top: .7rem; border-top: 1px solid #58466f; padding-top: .5rem; }
.story-comments summary, #story-reports summary, #hidden-stories summary { cursor: pointer; color: #ead6ff; font-weight: 700; }
.story-comments summary { font-size: .86rem; }
.story-comments ul, #story-report-list { list-style: none; padding: 0; margin: .5rem 0; }
.story-comments li { padding: .45rem .1rem; font-size: calc(.86rem + 3px); }
.story-comments li + li { border-top: 1px solid #58466f; }
.story-comments li strong { margin-right: .5rem; }
.story-comments form { margin-top: .5rem; }
.story-comments textarea {
  display: block; width: 100%; resize: vertical; padding: .5rem; margin-bottom: .4rem;
  border: 1px solid #685287; border-radius: .4rem; background: #241c32; color: inherit; font: inherit;
}
.story-comments form button { background: #d9bbf4; color: #2c1744; padding: .35rem .6rem; font-size: .82rem; }
.story-comments [role="status"]:empty { display: none; }
#story-reports[open] summary { margin-bottom: .65rem; }
#story-report-list li { padding: .55rem 0; overflow-wrap: anywhere; }
#story-report-list li + li { border-top: 1px solid #58466f; }
#story-report-list li p { margin: .28rem 0; color: inherit; white-space: pre-wrap; }
.story-report-actions { display: flex; gap: .3rem; }
#story-report-list .report-preview { color: #d0bbdf; font-size: .84rem; }
.notice-remove {
  float: right; background: transparent; color: #ffb8c6; padding: .2rem .38rem; font-size: .77rem;
}
.notice-remove:hover { background: #54283c; }
#noticeboard-status:empty, #notice-archive-status:empty { display: none; }
.notice-archive summary { cursor: pointer; color: #f7ca8c; font-weight: 700; }
.notice-archive[open] summary { margin-bottom: .65rem; }
#notice-archive-entries { max-block-size: 18rem; overflow: auto; list-style: none; margin: 0; padding: 0; }
#notice-archive-entries li { padding: .55rem 0; overflow-wrap: anywhere; }
#notice-archive-entries li + li { border-top: 1px solid var(--border); }
#notice-archive-entries p { margin: .22rem 0; white-space: pre-wrap; }
#notice-archive-entries time { display: inline-block; margin-right: .5rem; font-size: .79rem; color: var(--muted); }
#notice-archive-entries button { padding: .27rem .55rem; font-size: .8rem; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(max-content, .44fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}
#home .alliance-feeds { margin-top: 1rem; }
.mascot-layer {
  position: relative;
  height: clamp(7.7rem, 12vw, 9rem);
  min-width: 0;
  overflow: hidden;
  pointer-events: none;
}
@media (min-width: 81rem) {
  #home { position: relative; }
  .home-hero { grid-template-columns: minmax(0, 1fr); min-height: 9rem; }
  .mascot-layer {
    position: absolute;
    inset: 0 -2.5rem auto calc(var(--feed-width) + 3rem);
    height: 15rem;
    --mascot-stage-share: 1;
    --mascot-scene-height: 232;
  }
  .mascot { --size: 116px; }
}
@media (max-width: 52rem) {
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
}
.mascot {
  --size: 72px;
  position: absolute;
  width: var(--size);
  height: var(--size);
  transform: translate3d(var(--mascot-x, 0), var(--mascot-y, 0), 0);
  transition: transform var(--travel, 0ms) linear, opacity .48s ease;
}
.mascot-girl { --sprite-row: 100%; }
.mascot-sprite { position: absolute; }
.mascot-sprite {
  inset: 0;
  background: url("alliance-mascots-3d.png") no-repeat 0 var(--sprite-row, 0%);
  background-size: 400% 200%;
  transform: scaleX(var(--mascot-facing, 1));
  filter: drop-shadow(0 .2rem .24rem #170e1dbd);
}
.mascot[data-scene="walk"] .mascot-sprite { animation: mascot-walk .38s steps(1, end) infinite; }
@keyframes mascot-walk {
  0%, 100% { background-position-x: 33.333%; }
  50% { background-position-x: 66.667%; }
}
.mascot[data-scene="wave"] .mascot-sprite { background-position-x: 100%; }
.mascot-bubble {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  display: block; width: max-content; max-width: 8rem; padding: .2rem .4rem;
  color: #ffeef6; background: transparent;
  font: 700 .69rem/1.25 Roboto, sans-serif; text-align: center;
}
@media (max-width: 38rem) {
  .mascot { --size: 56px; }
  .mascot-bubble { font-size: .62rem; }
}
@media (prefers-reduced-motion: reduce) { .mascot-layer { display: none; } }
#notice-archive-entries img { display: block; max-width: 100%; max-height: 6rem; border-radius: .4rem; margin: .3rem 0; }

.mascot-activity {
  position: absolute;
  width: var(--scene-width, 240px);
  aspect-ratio: var(--scene-aspect, 2);
  filter: drop-shadow(0 .24rem .32rem #170e1d94);
  opacity: 1;
  transition: opacity var(--scene-fade-in, 220ms) ease-out;
}
.mascot-activity.mascot-fading { opacity: 0; transition-duration: var(--scene-fade-out, 720ms); }
.mascot-activity::before, .mascot-activity::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--activity-art);
  background-repeat: no-repeat;
  background-size: 200% var(--sheet-height, 200%);
  background-position-y: var(--scene-row, 0%);
}
.mascot-activity::before {
  background-position-x: 0%;
  animation: mascot-activity-poses var(--scene-cycle, 2s) linear infinite;
}
.mascot-activity::after {
  background-position-x: 100%;
  animation: mascot-activity-action var(--scene-cycle, 2s) linear infinite;
}
@keyframes mascot-activity-poses {
  0%, 43%, 96%, 100% { opacity: 1; }
  50%, 89% { opacity: 0; }
}
@keyframes mascot-activity-action {
  0%, 43%, 96%, 100% { opacity: 0; }
  50%, 89% { opacity: 1; }
}
.profile-menu { position: relative; z-index: 5; }
.profile-menu > summary { cursor: pointer; list-style: none; }
.profile-menu > summary::-webkit-details-marker { display: none; }
.profile-menu > .masthead-avatar { overflow: visible; }
.profile-menu .masthead-avatar img { border-radius: 50%; }
.profile-menu #profile-unread-dot {
  position: absolute; right: -1px; top: 0; width: .65rem; height: .65rem; margin: 0;
  border: 1px solid #2c1d30; border-radius: 50%; background: #ffabc9;
}
.profile-menu-panel {
  position: absolute; right: 0; top: calc(100% + .55rem); min-width: 10rem;
  border: 1px solid #754a68; border-radius: .7rem; background: #332439;
  padding: .32rem; box-shadow: 0 .55rem 1.2rem #120c1688;
}
.profile-menu-panel a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .52rem .6rem; color: #ffe5ca; text-decoration: none; border-radius: .4rem;
}
.profile-menu-panel a:hover { background: #50314b; }
.masthead #notification-badge { margin: 0; background: #713e58; border-radius: 1em; padding: .08rem .38rem; color: #fff2f7; font-size: .73rem; }
.notification-panel { max-width: 56rem; }
.notification-toolbar { display: flex; justify-content: flex-end; }
.notification-toolbar button { padding: .45rem .7rem; }
#notification-list { list-style: none; padding: 0; margin: .4rem 0 0; }
#notification-list li + li { border-top: 1px solid var(--border); }
#notification-list button {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .22rem .65rem;
  width: 100%; padding: .65rem; background: transparent; color: inherit; text-align: left; overflow-wrap: anywhere;
}
#notification-list button:hover, #notification-list .notification-unread button { background: #3d293c; }
#notification-list time, #notification-list button span { color: var(--muted); font-size: .8rem; font-weight: 400; }
#notification-list button span { grid-column: 1 / -1; }
#notification-target-status:empty, #notification-status:empty { display: none; }
.story-reactions { flex-wrap: wrap; }
.story-comment-reply { border-left: 2px solid #a681bf; padding-left: .55rem !important; margin-left: .55rem; }
.story-comments blockquote { margin: .3rem 0; border-left: 2px solid #685287; padding: .22rem .45rem; color: #d0bbdf; overflow-wrap: anywhere; }
.story-comments li button, .story-comments .story-reply-context button {
  background: transparent; color: #e6c8f7; padding: .16rem .3rem; font-size: .78rem;
}
.story-reply-context { display: flex; align-items: center; justify-content: space-between; color: #eccdfb; margin-bottom: .3rem; font-size: .83rem; }
@media (max-width: 36rem) { #notification-list button { grid-template-columns: minmax(0, 1fr); } }

#remember-login { display: flex; align-items: center; gap: .45rem; }
#remember-login input { width: auto; }

#player-rows input, #player-rows select { min-width: 7rem; width: 100%; }
#player-rows input[aria-label^='Name'] { min-width: 10rem; }
.roster-row-edited { box-shadow: inset 3px 0 #deb972; }

/* Text buttons use the same hit areas and reveal lines on hover or focus. */
:where(button, [role="button"]) {
  position: relative;
}
:is(button, [role="button"], input:is([type="submit"], [type="button"], [type="reset"])) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--text-button-color, var(--gold)) !important;
}
.danger-button { --text-button-color: #ffc0d4; }
button[aria-pressed="true"], button[aria-expanded="true"].emoji-toggle {
  --text-button-color: #fff1da;
  text-decoration: underline;
  text-underline-offset: .26em;
}
:is(button, [role="button"])::before {
  content: "";
  position: absolute;
  inset: 1px .3rem;
  pointer-events: none;
  border-block: 1px solid currentColor;
  transform: scaleX(0);
  transition: transform .22s ease-out;
}
:is(button, [role="button"]):is(:hover, :focus-visible):not(:disabled)::before {
  transform: scaleX(1);
}
:is(button, [role="button"], input:is([type="submit"], [type="button"], [type="reset"])):focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: .26em;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :is(button, [role="button"]):not(:disabled):hover::after {
    content: "";
    position: absolute;
    pointer-events: none;
    left: 50%;
    top: 22%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff5da;
    box-shadow: 7px 5px #ffcbef, 12px -3px #fff1bc, -11px 4px #ebc8ff, -6px 8px #ffedc5;
    animation: button-fizz .85s ease-out infinite;
  }
  @keyframes button-fizz {
    from { opacity: 0; transform: translateY(5px) scale(.6); }
    32% { opacity: .9; }
    to { opacity: 0; transform: translateY(-15px) scale(1.2); }
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(button, [role="button"])::before { transition: none; }
}
@media (forced-colors: active) {
  :is(button, [role="button"], input:is([type="submit"], [type="button"], [type="reset"])):focus-visible {
    outline: 2px solid CanvasText;
  }
}

#show-stories, #show-notices { font-family: Roboto, sans-serif; }

#chat-messages p,
.story-card p,
.story-comments li,
.alliance-notice p,
#notice-archive-entries p {
  font-family: "Cormorant Garamond", Georgia, serif;
}

.alliance-feed > .planner-panel,
.alliance-feed .story-card { border: 0; }

/* Keep native selection and keyboard behavior for every dropdown. */
select {
  background: transparent !important;
  color: var(--gold) !important;
  border-color: transparent !important;
  border-radius: 2px !important;
  color-scheme: dark;
  font: inherit;
  min-height: 2.35rem;
}
select:enabled { cursor: pointer; }
select:enabled:hover { color: #fff1da !important; }
select:focus-visible { outline: none; text-decoration: underline; text-underline-offset: .24em; }
select:disabled { opacity: .66; }

@supports (appearance: base-select) {
  select, select::picker(select) { appearance: base-select; }
  select::picker-icon { color: currentColor; font-size: .8em; }
  select:open::picker-icon { rotate: 180deg; }
  select::picker(select) {
    margin-block: .25rem;
    max-block-size: min(19rem, 55dvh);
    max-inline-size: calc(100vw - 1rem);
    padding: .3rem;
    border: 0;
    background: transparent;
    backdrop-filter: blur(16px) brightness(.42);
  }
  select option {
    position: relative;
    min-block-size: 2.2rem;
    padding: .42rem .6rem;
    color: var(--gold);
    background: transparent;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  select option + option { margin-block-start: .25rem; }
  select option:enabled:is(:hover, :focus-visible) {
    color: #fff1da;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: .24em;
  }
  select option:checked { font-weight: 700; }
  select option:disabled { opacity: .58; }
  select option::checkmark { order: 1; margin-inline-start: auto; }
}

@media (hover: hover) {
  select:enabled:not(:open):hover { scale: 1.05; }
  #bear-leader-stock:enabled:not(:open):hover, #brawl-stage:enabled:not(:open):hover { scale: 1; }
  select option:enabled:hover {
    scale: 1.05;
    transform-origin: center left;
  }
}
@media (forced-colors: active) {
  select:focus-visible { outline: 2px solid CanvasText; }
}

/* Player story cards use a light surface within the dark alliance feed. */
.story-card {
  background: #fbf8fc;
  color: #30243b;
}
.story-card strong { color: #30243b; }
.story-card time,
.story-card .story-comments blockquote,
.story-card .story-reply-context { color: #64536e; }
.story-card .story-comments,
.story-card .story-comments li + li { border-color: #d5c5df; }
.story-card .story-comments summary { color: #483357; }
.story-card .story-comments textarea {
  background: #fff;
  border-color: #987fa8;
}
.story-card button { --text-button-color: #62421e; }
.story-card button[aria-pressed="true"] { --text-button-color: #53366a; }
.story-card .story-delete { --text-button-color: #882f49; }

.alliance-notice p,
#notice-archive-entries p { font-size: calc(1em + 1px); }

.chat-panel,
button.chat-launcher { font-size: calc(1rem + 2px); }
.chat-presence summary { font-size: calc(.875rem + 2px); }
#chat-online li { font-size: calc(.88rem + 2px); }
.chat-meta time { font-size: calc(.74rem + 2px); }
.chat-status { font-size: calc(.85rem + 2px); }
.chat-reply-button, .chat-first-unread::before { font-size: calc(.75rem + 2px); }
.chat-file-link { font-size: calc(.86rem + 2px); }
.chat-tags button, #chat-file-draft { font-size: calc(.8rem + 2px); }
.chat-badge { font-size: calc(.72rem + 2px); }
.chat-compose input { min-width: 0; }

#hidden-story-list { display: grid; gap: .6rem; list-style: none; margin: .65rem 0 0; padding: 0; }
#hidden-story-list li { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
#hidden-story-list li span { overflow-wrap: anywhere; }
#hidden-story-list button { flex: none; }

#alliance-welcome {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  height: 100dvh;
  overscroll-behavior: none;
  color: #fff1db;
  background: radial-gradient(ellipse at 50% 37%, #37221938, transparent 68%),
    #683d33 url("fun-welcome-cozy.png") center / cover no-repeat;
}
@media (orientation: portrait) {
  #alliance-welcome { background-image: radial-gradient(ellipse at 50% 37%, #37221938, transparent 68%), url("fun-welcome-cozy-mobile.png"); }
}
html { scrollbar-gutter: stable; scrollbar-width: thin; }
html:has(#alliance-welcome[open]) { overflow: hidden; }
#alliance-welcome::backdrop { background: transparent; }
#home .home-hero h1:focus, #auth-heading:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (background-clip: text) {
    #alliance-welcome[open] .alliance-welcome-name {
      display: inline-block;
      background: linear-gradient(103deg, #fff1db 37%, #ffce76 46%, #fffef5 50%, #ffd88c 54%, #fff1db 63%) 100% 50% / 290% 100% no-repeat;
      background-clip: text;
      color: transparent;
      text-shadow: none;
      filter: drop-shadow(0 2px 8px #41271f);
      animation: welcome-name-shimmer 1420ms 200ms ease-in-out both;
    }
  }
  #alliance-welcome[open] .alliance-welcome-content p { animation: welcome-content-in 1050ms 1080ms ease-out both; }
}
@keyframes welcome-name-shimmer { from { background-position: 100% 50%; } to { background-position: 0% 50%; } }
@keyframes welcome-content-in {
  0% { opacity: 0; transform: translateY(12px); }
  67% { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 1; transform: translateY(0); }
}
.alliance-welcome-content {
  position: relative;
  box-sizing: border-box;
  min-height: 100%;
  padding: 22dvh 1rem min(5dvh, 2rem);
  text-align: center;
  text-shadow: 0 2px 10px #41271f, 0 0 22px #ebba8a32;
}
.alliance-welcome-gamepad {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 22dvh + .85rem);
  width: min(8.75rem, 37vw, 24dvh);
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 10px #53322980);
  pointer-events: none;
}
.alliance-welcome-content h1 {
  margin: 0;
  font: 700 clamp(2.2rem, min(13vw, 19dvh), 9rem)/.85 "Cormorant Garamond", Georgia, serif;
  letter-spacing: .09em;
  text-indent: .09em;
  color: inherit;
}
.alliance-welcome-label {
  display: block;
  margin-top: min(2dvh, .85rem);
  font-size: clamp(.85rem, min(3vw, 7dvh), 2rem);
  letter-spacing: .45em;
  text-indent: .45em;
}
.alliance-welcome-content p { margin: min(2.4dvh, 1.25rem) 0 min(5dvh, 2.15rem); font-size: clamp(.88rem, 2vw, 1.15rem); }
.alliance-welcome-action { position: relative; width: min(16rem, 90%); margin-inline: auto; }
.alliance-welcome-sparks { position: absolute; inset: 0; pointer-events: none; }
.alliance-welcome-sparks span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 13%, #ffe5a6 33%, #ffbd6060 57%, transparent 72%);
  box-shadow: 0 0 9px #ffe0a999;
}
.alliance-welcome-sparks span:nth-child(3n) {
  width: 11px;
  height: 11px;
  background: #fff1d3;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.alliance-welcome-sparks span:nth-child(3n + 1) { box-shadow: 0 0 10px #efc69480; }
#alliance-enter {
  width: 100%;
  min-height: clamp(2.75rem, 13dvh, 4.4rem);
  border: 1px solid #edd1a1;
  border-radius: 1.2rem;
  color: #fff7df;
  background: linear-gradient(#744a3e, #57382f);
  text-shadow: 0 1px 4px #402722;
  font: 700 1.85rem "Cormorant Garamond", Georgia, serif;
  letter-spacing: .18em;
  box-shadow: 0 .4rem 0 #39241dcc, 0 0 1.6rem #edbf7b29, inset 0 -5px 14px #e6b98936;
  transition: transform .13s ease, box-shadow .13s ease, filter .13s ease;
}
#alliance-enter:hover { filter: brightness(1.18); }
#alliance-enter:active { transform: translateY(.3rem); box-shadow: 0 .1rem 0 #39241dcc, inset 0 2px 10px #302017a0; }
#alliance-enter:focus-visible { outline: 2px solid #fff7df; outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) { #alliance-enter { transition: none; } }

.player-filters > label { flex: 1 1 15rem; }
.player-filter { position: relative; flex: 1 1 auto; }
.player-filter summary {
  cursor: pointer;
  padding: .6rem .75rem;
  border: 1px solid #795b74;
  border-radius: .6rem;
  color: var(--gold);
  background: #362936;
}
.player-filter summary[data-count]:not([data-count=""])::after { content: " (" attr(data-count) ")"; }
.player-filter fieldset {
  position: absolute;
  z-index: 4;
  min-width: 100%;
  width: max-content;
  max-width: min(15rem, 80vw);
  max-height: 15rem;
  overflow: auto;
  margin: .2rem 0 0;
  padding: .45rem .7rem;
  border: 1px solid #795b74;
  border-radius: .6rem;
  background: #302330;
  box-shadow: 0 8px 18px #140e19a6;
}
.player-filter label { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; }
.player-filter input { width: auto; margin: 0; }
@media (max-width: 38rem) { .player-filter fieldset { position: static; width: auto; } }

#chat-messages .chat-nudge-message {
  display: block;
  text-align: center;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-panel .actions button.player-view-mode { border: 0; background-color: #304c55; color: #fff; }
.account-panel .actions button.player-view-mode[aria-pressed="true"] { background-color: #54757c; }
.player-list-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; margin-bottom: .35rem; }
.player-list-heading h2 { margin: 0; }
.player-list-heading .player-stat-actions { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.player-stat-dialog { width: min(calc(100% - 2rem), 62rem); max-height: calc(100dvh - 2rem); }
.player-stat-dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.player-stat-dialog-heading h2 { margin: 0; }
#player-stat-review, #player-stat-history-rows { overflow: auto; max-height: 50dvh; }
#player-stat-history-more { margin-top: .75rem; }
#player-editor { width: min(calc(100% - 2rem), 100rem); }
#player-editor-table { max-height: 60dvh; overflow: auto; }
#player-editor-table table { min-width: 78rem; }
#player-editor-table td:first-child { min-width: 3rem; }
#player-editor-table :is(input, select) { width: 100%; min-width: 6rem; }
#player-editor-table :is([data-field="name"], [data-field="remarks"]) { min-width: 12rem; }
#player-editor-table th { position: sticky; top: 0; z-index: 1; background: #302433; white-space: nowrap; }
.player-editor-actions { align-items: center; }
#player-editor-pages:not([hidden]) { display: flex; flex-wrap: wrap; gap: .35rem; }
#player-editor-pages button { padding: .35rem .6rem; font-size: .88rem; }
#player-editor-pages button[aria-current="page"] { background: #514053; color: #fff4e9; }
#save-roster-edits { margin-inline-start: auto; }
@media (max-width: 640px) {
  .player-list-heading .player-stat-actions { margin-inline-start: 0; }
}
#player-stat-review table, #player-stat-history-rows table { width: 100%; }
#player-stat-review td, #player-stat-history-rows td { padding: .3rem; }
#player-stat-review input, #player-stat-review select { width: 100%; min-width: 6rem; }
#player-stat-review [data-unmatched="true"] { color: #ffd197; }

.bear-event-card { margin-block: 1rem; }
.bear-tabs { flex-wrap: wrap; margin-bottom: 1rem; }
.bear-tabs [aria-pressed="true"] { background: #49374c; color: #fff4e9; }
.bear-panel p { max-width: 72ch; }
#bear-heroes > p:first-of-type { max-width: none; }
.bear-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .8rem; }
.bear-presets { margin-block: 1rem; }
.bear-panel .roster-table input[type="checkbox"] { width: auto; }
#bear-heroes .roster-table :is(input[type="number"], select) { min-width: 5rem; }
#bear-formation-results { margin-block-start: 1rem; }
#bear-formation-results table { min-width: 23rem; }
.bear-source { color: var(--muted); font-size: .86rem; }
#bear-hunts { table-layout: fixed; min-width: 48rem; }
#bear-hunts th { width: 20%; }
#bear-hunts td:first-child { min-width: 0; white-space: nowrap; }
#bear-hunts td:nth-child(2), #bear-hunts td:nth-child(3) { font-variant-numeric: tabular-nums; }
#bear-hunts td:nth-child(4) { overflow-wrap: anywhere; }
#bear-hunt-fields > .bear-grid { margin-block-start: .75rem; }
#bear-analyze-hunts { margin-block-start: .75rem; }
#bear-hunt-analysis { margin-block: .5rem 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: .65rem; }
#bear-hunt-analysis h3 { margin: 0 0 .35rem; }
.bear-analysis-chart { display: grid; gap: .65rem; list-style: none; padding: 0; margin: .85rem 0 0; }
.bear-analysis-chart li { display: grid; grid-template-columns: auto minmax(1.5rem, 1fr) auto; gap: .3rem .75rem; align-items: center; font-variant-numeric: tabular-nums; }
.bear-analysis-track { height: .65rem; border-radius: 1rem; background: #382d3d; overflow: hidden; }
.bear-analysis-bar { display: block; height: 100%; background: #edbd79; border-radius: inherit; }
@media (max-width: 34rem) {
  .bear-analysis-chart li { grid-template-columns: 1fr auto; }
  .bear-analysis-track { grid-column: 1 / -1; grid-row: 2; }
}

.bear-more { margin-top: 1rem; }
.bear-more > summary { color: var(--gold); margin-bottom: .7rem; }
:is(#bear-rally, #bear-formation) { line-height: 1.6; }
:is(#bear-rally, #bear-formation) > h2 { margin-block-end: .8rem; }
#bear-rally > .bear-choices, #bear-formation > .bear-grid { margin-block-start: 1.35rem; }
#bear-formation > .bear-grid { gap: 1.2rem 1.65rem; }
:is(#bear-rally, #bear-formation) .bear-choices legend { margin-block-end: .55rem; }
:is(#bear-rally, #bear-formation) .bear-choices > div { gap: .6rem 1rem; }
:is(#bear-rally, #bear-formation) .bear-lineups { gap: 1rem; margin-block: 1.4rem; }
:is(#bear-rally, #bear-formation) .bear-lineups article { padding: 1.2rem; }
:is(#bear-rally, #bear-formation) .bear-lineups h3 { margin-block-end: .8rem; }
:is(#bear-rally, #bear-formation) .bear-lineups ul { margin-block: .85rem; }
:is(#bear-rally, #bear-formation) .bear-lineups li + li { margin-block-start: .5rem; }
.bear-choices { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.bear-choices legend { margin-block-end: .35rem; padding: 0; }
.bear-choices > div { display: flex; flex-wrap: wrap; gap: .4rem .8rem; }
.bear-choices label { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.bear-choices input[type="radio"] { width: auto; margin: 0; accent-color: var(--gold, #efbe81); }
.bear-lineups { display: grid; gap: .8rem; margin-block: 1rem; }
.bear-lineups article { padding: 1rem; }
.bear-lineups h3 { margin: 0 0 .55rem; }
.bear-portraits { display: flex; flex-wrap: wrap; gap: .5rem; }
.bear-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.75rem;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: #352736;
  color: var(--gold);
  font-weight: 700;
}
.bear-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #352736; }
.bear-lineups ul { margin-block: .6rem; padding-inline-start: 1.25rem; }
.bear-lineups li + li { margin-top: .35rem; }
.bear-ratio { color: var(--gold); margin-bottom: 0; }
#bear-hero-table { table-layout: fixed; min-width: 49rem; }
#bear-hero-table th { text-align: left; }
#bear-hero-table td { text-align: left; }
#bear-hero-table th:nth-child(1) { width: 6%; }
#bear-hero-table th:nth-child(2) { width: 16%; }
#bear-hero-table th:nth-child(3) { width: 14%; }
#bear-hero-table th:nth-child(4) { width: 18%; }
#bear-hero-table th:nth-child(5) { width: 11%; }
#bear-hero-table th:nth-child(6) { width: 14%; }
#bear-hero-table td:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
#bear-hero-table td:last-child { white-space: nowrap; }
.bear-roster-hero { display: flex; align-items: center; gap: .5rem; }
.bear-roster-hero .bear-portrait { width: 2.25rem; flex-shrink: 0; }
.bear-roster-stars { color: #ffd990; font-size: 1.2rem; letter-spacing: .1em; white-space: nowrap; }

.bear-hero-basics, .bear-skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .8rem; }
.bear-hero-basics { align-items: end; }
.bear-expedition { margin-top: 1rem; }
.bear-pick-group { min-width: 0; margin: 0; padding: .55rem .65rem; background: #261e27; }
.bear-pick-group legend { font-size: .9rem; }
.bear-picks { display: flex; flex-wrap: wrap; gap: .3rem; }
.bear-picks label { position: relative; display: inline-flex; }
.bear-picks input { position: absolute; opacity: 0; width: 100%; inset: 0; height: 100%; margin: 0; cursor: pointer; }
.bear-picks span { display: inline-grid; place-items: center; min-width: 1.85rem; min-height: 1.95rem; border-radius: .45rem; background: #342737; color: #eedbea; }
.bear-picks input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.bear-picks input:checked + span { background: #68506b; color: #fff1dc; }
.bear-picks label.bear-skill-lit span { background: #68506b; color: #fff1dc; }
.bear-star-picks span { color: #d6aa67; font-family: "Segoe UI Symbol", sans-serif; font-size: 2rem; min-width: 2.3rem; min-height: 2.55rem; background: transparent; }
.bear-star-picks label.bear-star-lit span { color: #ffd990; -webkit-text-stroke: 1px #ffd990; text-shadow: 0 0 .5rem #d38a43; }
#bear-skill-preview { color: #f2d0a1; margin: .65rem 0 0; }
.bear-pick-group:disabled { opacity: .55; }

/* Leave room for the fixed Alliance Chat launcher on desktop. */
@media (min-width: 64rem) {
  #bear-lab, #alliance-brawl { max-width: calc(50% + 50vw - 13rem); }
}
.bear-lab-header { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: .75rem 1.1rem; }
.bear-lab-art {
  display: block;
  width: min(100%, 35rem);
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent),
              linear-gradient(to bottom, transparent, black 21%, black 79%, transparent);
  mask-composite: intersect;
}
@media (max-width: 53rem) {
  .bear-lab-header { grid-template-columns: minmax(0, 1fr); }
}

/* Alliance Brawl */
.event-tools { margin-block: 1rem; }
.event-tools .bear-event-card { margin: 0; }
.event-tools .brawl-event-card { border-color: #a46c43; }
.brawl-switch button[aria-pressed="true"] { border: 1px solid #e0aa64; border-radius: .55rem; padding: .55rem .85rem; background: #f0bd73; color: #2d160e; font-weight: 800; text-decoration: none; }
.brawl-hero { padding: clamp(1.2rem, 5vw, 3.65rem); border: 1px solid #a4673b; border-radius: 1rem; color: #fff3dc; background: radial-gradient(ellipse at 90% 85%, #ab512e80, transparent 56%), linear-gradient(122deg, #23181d, #482931 77%, #6f3225); }
.brawl-hero .back { color: #ffe0ab; }
.brawl-hero h1 { color: #fff3dc; margin: .6rem 0 .2rem; font-size: clamp(2.15rem, 6vw, 4.25rem); line-height: 1.04; }
.brawl-hero p { color: #efd1a4; margin: .65rem 0 1.4rem; }
.brawl-switch { display: flex; gap: .55rem; flex-wrap: wrap; }
.brawl-switch button { color: #fff3dc; background: #2c1e25; border: 1px solid #c49973; }
.brawl-content { display: grid; gap: .9rem; margin-block: .9rem; }
.brawl-scoreboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.brawl-scoreboard > div { display: grid; place-items: center; align-content: center; min-height: 7rem; padding: .65rem .4rem; text-align: center; border-radius: .55rem; border: 1px solid #88634c; background: #302126; color: #ffe7c0; }
.brawl-scoreboard > div:last-child { background: #4b2c37; }
.brawl-scoreboard > div:nth-child(2) { background: #453323; }
.brawl-scoreboard strong { font-size: clamp(1.65rem, 5vw, 2.5rem); line-height: 1.1; color: #ffd182; }
.brawl-scoreboard span { font-size: .85rem; font-weight: 800; }
.brawl-scoreboard small { color: #edd7ba; }
.brawl-rounds { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .35rem; }
.brawl-rounds li { padding: .52rem .12rem; text-align: center; border: 1px solid #946f56; border-radius: .45rem; background: #322726; color: #fff1d9; }
.brawl-rounds [data-result="active"] { background: #e9aa60; color: #21140d; font-weight: 800; }
.brawl-rounds [data-result="won"] { background: #285343; }
.brawl-rounds [data-result="lost"] { background: #6b3144; }
.brawl-panel { display: grid; gap: .82rem; }
.brawl-panel h2 { margin: 0; }
.brawl-panel #brawl-result:empty { display: none; }
#brawl-push { display: grid; gap: .65rem; margin-top: .8rem; }
#brawl-push :is(button, input) { width: 100%; }
#brawl-spend { accent-color: #bd7135; }
#brawl-rematch { justify-self: start; }
.brawl-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .75rem; }
.brawl-fields :is(input, select) { width: 100%; }
#brawl-tasks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
#brawl-tasks label { display: grid; grid-template-columns: minmax(0, 1fr) 5.8rem; align-items: center; gap: .45rem; border: 1px solid #987455; border-radius: .4rem; padding: .55rem; }
#brawl-tasks input { width: 100%; min-width: 0; }
#brawl-tasks small { display: block; color: var(--muted); }
.brawl-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem .9rem; border-radius: .55rem; background: #302126; color: #ffe7c0; }
#brawl-points { color: #ffd182; font-size: 1.45rem; font-weight: 800; }
@media (max-width: 43rem) { #brawl-tasks, .brawl-fields { grid-template-columns: 1fr; } }

.brawl-skill-help {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0;
  border-radius: 50%;
  background: #f0bd73;
  color: #2d160e;
  font-weight: 800;
  vertical-align: middle;
}

.brawl-skill-label { margin-bottom: .25rem; }
.brawl-skill-label label { display: inline; margin: 0; }
.brawl-skill-caption { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.brawl-skill-help { flex: 0 0 auto; width: 1.5rem; height: 1.5rem; border: 1px solid #a96b3c; border-radius: 50%; font-family: Georgia, serif; font-style: italic; line-height: 1; }

.brawl-skill-label label, #brawl-skill-help, #brawl-bonus { cursor: pointer; }

.brawl-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  align-items: center;
  gap: 1rem;
}
.brawl-hero-art {
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse closest-side, #efa75648 0%, #aa593728 65%, transparent 100%);
}
.brawl-hero-art img {
  display: block;
  width: min(84%, 19rem);
  height: auto;
  mask-image: radial-gradient(ellipse at center, #000 62%, #000e 76%, transparent 95%);
}
@media (max-width: 53rem) {
  .brawl-hero { grid-template-columns: minmax(0, 1fr); }
  .brawl-hero-art { width: min(100%, 22rem); justify-self: center; }
  .brawl-hero-art img { width: min(75%, 13rem); }
}

.event-art-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.event-art-header > figure > img {
  display: block;
  width: 100%;
  aspect-ratio: 2.2;
  object-fit: cover;
  object-position: center;
  mask-image: linear-gradient(to right, transparent, black 19%, black 81%, transparent),
              linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  mask-composite: intersect;
}
@media (max-width: 53rem) {
  .event-art-header { grid-template-columns: minmax(0, 1fr); }
  .event-art-header > figure { width: min(100%, 32rem); justify-self: center; }
}

#brawl-stage, #brawl-history, #brawl-edit-stages select { appearance: auto; }
#brawl-stage:hover { text-decoration: none; }
.brawl-skill-caption { position: relative; }
#brawl-skill-table { display: none; position: absolute; z-index: 5; inset-block-start: 100%; inset-inline-end: 0; width: min(21rem, 75vw); white-space: normal; background: #32252d; border: 1px solid #a96b3c; padding: .65rem; box-shadow: 0 .4rem 1rem #171014a0; }
#brawl-skill-help:is(:hover, :focus-visible) + #brawl-skill-table, #brawl-skill-table:hover { display: block; }
@media (max-width: 43rem) { #brawl-skill-table { inset-inline-end: auto; inset-inline-start: 0; } }
#brawl-horn-bar { display: flex; gap: .22rem; margin-block: .75rem; }
#brawl-horn-bar span { flex-basis: 0; display: grid; place-items: center; min-height: 1.8rem; border-radius: .24rem; background: #52424d; color: #fff5e3; font-weight: 800; }
#brawl-horn-bar [data-result="won"] { background: #27694d; }
#brawl-horn-bar [data-result="lost"] { background: #9a354b; }
#brawl-horn-bar [data-result="tied"] { background: #875c26; }
#brawl-event-form { display: grid; gap: 1rem; }
.brawl-event-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 12rem),1fr)); gap: .75rem; }
.brawl-event-fields :is(input, select) { width: 100%; }
.event-art-header > figure { position: relative; margin: 0; }
.event-art-header > figure > img { width: 100%; }

#brawl-skill-help { cursor: help; }

.event-art-header > .tri-hero-banner {
  aspect-ratio: 2.2;
  overflow: hidden;
  background: linear-gradient(#24172120, #21162091), url("tri-alliance-art.png?v=heroes") center / cover;
  mask-image: linear-gradient(to right, transparent, black 14%, black 86%, transparent),
              linear-gradient(to bottom, transparent, black 15%, black 83%, transparent);
  mask-composite: intersect;
}
.event-art-header > .tri-hero-banner > .tri-banner-hero {
  position: absolute;
  bottom: 0;
  width: 34%;
  height: 88%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center bottom;
  mask-image: none;
  filter: drop-shadow(0 .25rem .4rem #160e1890);
}
.tri-banner-hero.helga { left: 5%; }
.tri-banner-hero.amadeus { left: 33%; height: 95% !important; z-index: 1; }
.tri-banner-hero.hilde { right: 5%; }

#brawl-stage { background: #261c24 !important; color: #ffebcd !important; border: 1px solid #77513d !important; border-radius: .45rem !important; padding-inline: .65rem; }
#brawl-stage option { background: #261c24; color: #ffebcd; scale: 1; }
#brawl-stage:focus-visible { outline: 2px solid var(--gold); text-decoration: none; }
#brawl-skill-table { padding: 1rem; line-height: 1.5; }
#brawl-skill-table table { width: 100%; border-collapse: collapse; margin-top: .7rem; }
#brawl-skill-table :is(th, td) { text-align: center; padding: .35rem .3rem; border-bottom: 1px solid #624752; }
#brawl-skill-table tbody tr:last-child > * { border-bottom: 0; }
#brawl-match { list-style: none; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: .35rem .8rem; align-items: center; padding: clamp(.75rem,3vw,1.65rem); border: 1px solid #956144; border-radius: .7rem; background: linear-gradient(110deg,#234039,#30212b 50%,#663142); color: #fff1d9; text-align: center; }
#brawl-match::-webkit-details-marker { display: none; }
#brawl-match:hover { border-color: #f0bd73; }
#brawl-match small, #brawl-match strong { display: block; overflow-wrap: anywhere; }
#brawl-match strong { font-size: clamp(1.35rem, 3vw, 2.25rem); }
#brawl-match time, .brawl-match-toggle { grid-column: 1 / -1; }
.brawl-versus { font-weight: 900; color: #f4bd75; }
.brawl-match-toggle { color: #ffd69d; margin-top: .35rem; }
.brawl-match-toggle::before { content: "View progress ↓"; }
#brawl-record[open] .brawl-match-toggle::before { content: "Hide progress ↑"; }
.brawl-match-details { padding-top: 1rem; }
#brawl-stage-results { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 10rem),1fr)); gap: .5rem; list-style: none; padding: 0; }
#brawl-stage-results li { display: grid; align-content: space-between; gap: .3rem; padding: .65rem; border: 1px solid #6b596a; border-radius: .45rem; background: #403441; color: #f6e9ed; }
#brawl-stage-results [data-result="won"] { border-color: #43896a; background: #254c3b; color: #b3f4cc; }
#brawl-stage-results [data-result="lost"] { border-color: #a6556c; background: #632e42; color: #ffd1db; }
#brawl-stage-results [data-result="tied"] { border-color: #a47c48; background: #594526; color: #ffe2a7; }
#brawl-event-form h3 { margin: 0; }

#brawl-history {
  appearance: auto; color-scheme: light; background: #f3e6d6 !important;
  color: #342329 !important; border: 1px solid #ad8c72 !important;
  border-radius: .4rem !important; padding-inline: .55rem; max-width: 100%;
}
#brawl-history option { background: #f3e6d6; color: #342329; }
#brawl-history:hover { scale: 1 !important; }
#brawl-edit-stages { grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); }
#brawl-edit-stages fieldset { padding: .65rem; }
#brawl-edit-stages p { font-size: .82rem; margin-bottom: .6rem; }
.brawl-result-options { display: flex; gap: .32rem; }
.brawl-result-options button { display: grid; place-content: center; gap: .1rem; flex: 1 1 0; min-width: 0; aspect-ratio: 1; max-width: 3.4rem; padding: .15rem; font-size: .76rem; border: 1px solid #79636c; background: #342934; color: #f6e9ed; }
.brawl-result-options button span { font-size: 1rem; line-height: 1; }
.brawl-result-options [aria-pressed="true"][data-result="won"] { background: #d8f2e4; color: #14603f; border-color: #3aab77; }
.brawl-result-options [aria-pressed="true"][data-result="lost"] { background: #fae1e6; color: #a12440; border-color: #d95e77; }
.brawl-danger { background: #81364a; color: #fff1ed; }
#brawl-analysis { border-top: 1px solid var(--border); padding-top: .75rem; }
.brawl-analysis-totals { display: flex; flex-wrap: wrap; gap: .5rem; }
.brawl-analysis-totals button { background: #403441; color: #f6e9ed; padding: .4rem .65rem; border-radius: .4rem; }
.brawl-analysis-totals [data-result="won"] { background: #27694d; }
.brawl-analysis-totals [data-result="lost"] { background: #9a354b; }
.brawl-analysis-totals [data-result="tied"] { background: #875c26; }
.brawl-analysis-chart { list-style: none; padding: 0; display: grid; gap: .65rem; }
.brawl-chart-track { display: flex; height: .78rem; border-radius: .35rem; overflow: hidden; background: #4b3e48; margin-block: .25rem; }
.brawl-chart-track [data-result="won"] { background: #50ad79; }
.brawl-chart-track [data-result="lost"] { background: #e36a80; }
#brawl-confirm, #brawl-final { width: min(34rem,calc(100% - 2rem)); margin: auto; }
#brawl-confirm::backdrop, #brawl-final::backdrop { background: #18121ad9; }
#brawl-final { text-align: center; padding: clamp(1.5rem,5vw,3.75rem); overflow: hidden; background: radial-gradient(ellipse at top,#663e45,#261e2b 65%); }
#brawl-final[data-result="won"] { background: radial-gradient(ellipse at top,#356b54,#2b2340 68%); }
#brawl-final h2 { position: relative; font-size: clamp(1.6rem,5vw,2.65rem); color: #ffe3a5; }
#brawl-final .actions { justify-content: center; }
#brawl-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#brawl-confetti span { position: absolute; top: -1.25rem; width: .5rem; height: .8rem; animation: brawl-confetti-fall 2.7s ease-in both; }
@keyframes brawl-confetti-fall { to { transform: translate(2rem, 25rem) rotate(520deg); } }
@media (prefers-reduced-motion: reduce) { #brawl-confetti { display: none; } }

#brawl-history:focus-visible { text-decoration: none; outline: 2px solid var(--gold); }
#brawl-match { position: relative; }
#brawl-match #brawl-closed-status { position: absolute; top: .65rem; right: .65rem; padding: .3rem .55rem; border-radius: .35rem; font-size: clamp(.78rem,1.5vw,1.1rem); line-height: 1; letter-spacing: .05em; background: #875c26; color: #fff4d7; }
#brawl-match #brawl-closed-status[data-result="won"] { background: #27694d; }
#brawl-match #brawl-closed-status[data-result="lost"] { background: #9a354b; }
#brawl-match:has(#brawl-closed-status:not([hidden])) { padding-top: 2.35rem; }
#brawl-progress-fields { display: grid; grid-template-columns: minmax(0, 1fr); }
#brawl-edit-stages { grid-template-columns: repeat(3,minmax(0,1fr)); }
#brawl-ranking-fields { display: grid; gap: .55rem; }
#brawl-analysis { width: min(46rem,calc(100% - 2rem)); max-height: 85dvh; overflow: auto; margin: auto; padding: 1.25rem; border-top: 1px solid var(--border); }
#brawl-analysis::backdrop { background: #18121ad9; }
.brawl-analysis-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.brawl-analysis-heading h2 { margin: 0; }
@media (max-width: 36rem) {
  #brawl-edit-stages { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 24rem) {
  #brawl-edit-stages { grid-template-columns: minmax(0,1fr); }
}

.brawl-kingdom-input { display: flex; align-items: center; gap: .45rem; padding-left: .55rem; border: 1px solid var(--border); border-radius: .4rem; background: #171518; color: var(--gold); }
.brawl-kingdom-input input { border: 0; padding-left: 0; }
.brawl-kingdom-input:focus-within { outline: 2px solid var(--gold); }
#brawl-ranking-fields input[list] { font-family: inherit; }
.brawl-day-and-podium { min-width: 0; }
.brawl-podium { margin: .85rem auto 0; text-align: center; max-width: 24rem; }
.brawl-podium-title { font: 900 clamp(1.8rem, 4.5vw, 3.75rem)/1.08 Georgia, serif; color: #ffe19a; text-shadow: 0 2px 0 #803c18, 0 3px 14px #d67e4a80; overflow-wrap: anywhere; }
.brawl-podium-names { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: .25rem; margin: .65rem 7% .1rem; }
.brawl-podium-names span { font-weight: 900; font-size: clamp(.8rem, 1.8vw, 1.25rem); color: #eaddeb; overflow-wrap: anywhere; }
.brawl-podium-names [data-place="1"] { color: #ffde8a; }
.brawl-podium-names [data-place="3"] { color: #f0b792; }
.brawl-podium img { display: block; width: 100%; height: auto; mask-image: linear-gradient(to right,transparent,#000 10% 90%,transparent),linear-gradient(to bottom,transparent,#000 10% 88%,transparent); mask-composite: intersect; }


.brawl-podium { width: 100%; max-width: 52rem; }
.brawl-podium-title { margin-bottom: .45rem; }
.brawl-podium-scene {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 2.25;
  mask-image: linear-gradient(to right,transparent,#000 8% 92%,transparent),linear-gradient(to bottom,transparent,#000 8% 92%,transparent);
  mask-composite: intersect;
}
.brawl-podium-scene::before {
  content: ""; position: absolute; z-index: -1; inset: -1rem;
  background: linear-gradient(#24193255,#24193255),url("brawl-podium.jpg") center 58% / cover;
  filter: blur(.65rem);
}
.brawl-podium .brawl-podium-scene img {
  position: absolute; bottom: 0; left: 18%; width: 64%; height: 90%;
  object-fit: fill; mask-image: linear-gradient(to right,transparent,#000 10% 90%,transparent);
}
.brawl-podium-names { position: absolute; inset: 0; display: block; margin: 0; }
.brawl-podium-names span {
  position: absolute; transform: translateX(-50%); max-width: 27%; padding: .16rem .45em;
  border: 1px solid #ffffff55; border-radius: .32rem; background: #211825ed;
  box-shadow: 0 2px 8px #100c1480; color: #fff4ff; line-height: 1.15; text-shadow: 0 1px 2px #170e1a;
}
.brawl-podium-names [data-place="2"] { top: 27%; left: 34%; }
.brawl-podium-names [data-place="1"] { top: 7%; left: 50%; color: #ffdf84; }
.brawl-podium-names [data-place="3"] { top: 36%; left: 67%; color: #ffd0ad; }
#brawl-final { display: grid; justify-items: center; text-align: center; }
#brawl-final:not([open]) { display: none; }
#brawl-final :is(h2, p) { width: 100%; text-align: center; margin-inline: auto; }
#brawl-final-score { font-weight: 700; }
@media (max-width: 34rem) {
  .brawl-podium-scene { aspect-ratio: 1.75; }
  .brawl-podium .brawl-podium-scene img { left: 9%; width: 82%; }
  .brawl-podium-names [data-place="2"] { left: 29%; }
  .brawl-podium-names [data-place="3"] { left: 72%; }
  .brawl-podium-names span { font-size: .68rem; }
}

.brawl-podium-names span { background: #36363be6; border-color: #ffffff42; }
#brawl-ranking-fields { border: 0; padding: 0; }
.brawl-team-photo { position: relative; margin: .9rem auto 0; width: min(100%, 46rem); text-align: center; }
.brawl-team-photo figcaption { color: #ffdfbc; font-weight: 800; font-size: clamp(1.05rem, 2.5vw, 1.75rem); margin-bottom: .55rem; overflow-wrap: anywhere; }
.brawl-team-photo img { display: block; width: 100%; height: auto; mask-image: linear-gradient(to right,transparent,#000 9% 91%,transparent),linear-gradient(to bottom,transparent,#000 10% 88%,transparent); mask-composite: intersect; }
#brawl-final { width: min(52rem, calc(100% - 2rem)); max-height: 90dvh; overflow: auto; padding: clamp(1rem, 3vw, 2rem); }
#brawl-final-art { width: 100%; }
#brawl-leaderboard-celebration .brawl-podium-title { font-size: clamp(1.3rem, 3.5vw, 2.65rem); }

#brawl-analysis-totals button { border: 1px solid transparent; text-decoration: none; }
#brawl-analysis-totals button:hover { border-color: #fff1d9a0; }
#brawl-analysis-totals button[aria-pressed="true"] { border-color: #ffe3a5; box-shadow: 0 0 0 2px #ffe3a55c; }
#brawl-analysis-status { margin-top: .75rem; }

.brawl-podium-title { text-align: center; }
.brawl-podium-title > span { display: block; margin-block-start: .22em; }

#brawl-ranking-fields { width: min(100%, 30rem); justify-self: start; }
#brawl-ranking-fields label:has(input[name="stars"]) { max-width: 12rem; }

#brawl-final { scrollbar-width: none; }
#brawl-final::-webkit-scrollbar { display: none; }

#brawl-leaderboard-celebration { width: min(52rem, calc(100% - 2rem)); max-height: 90dvh; overflow: auto; scrollbar-width: none; text-align: center; margin: auto; }
#brawl-leaderboard-celebration::-webkit-scrollbar { display: none; }
#brawl-leaderboard-celebration::backdrop { background: #18121ad9; }
#brawl-leaderboard-celebration .actions { justify-content: center; }
#brawl-final-art:focus { outline: none; }

#brawl-closed-by { margin-top: 1rem; text-align: right; font-size: .82rem; font-style: italic; }

#events .home-grid article > a {
  display: inline-flex;
  align-items: center;
  padding: .43rem .78rem;
  border: 1px solid #f6e4a6;
  border-radius: 999px;
  background: #fff0b9;
  color: #3b2c20;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 5px 0 #b38a3d, 0 8px 13px #140b1373;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
@media (hover: hover) {
  #events .home-grid article > a:hover {
    transform: translateY(-2px);
    background: #fff6d4;
    box-shadow: 0 7px 0 #b38a3d, 0 11px 15px #140b138c;
  }
}
#events .home-grid article > a:active {
  transform: translateY(5px) scale(.96);
  background: #f5d987;
  box-shadow: 0 1px 0 #9f7234, inset 0 2px 5px #9f723480;
  transition-duration: .05s;
}
@media (prefers-reduced-motion: reduce) {
  #events .home-grid article > a { transition: none; }
  #events .home-grid article > a:is(:hover, :active) { transform: none; }
}

#brawl-confirm-title { margin-block-end: .65rem; }

.bear-officer-tabs { margin-top: .25rem; margin-bottom: 1rem; gap: 1rem; }
.bear-attendance-traps { display: grid; gap: 1rem; margin-block: 1rem; }
.bear-attendance-trap { min-width: 0; }
.bear-attendance-trap .actions { flex-wrap: wrap; align-items: end; }
.bear-attendance-table { width: 100%; margin-top: .75rem; }
.bear-attendance-table td, .bear-attendance-table th { padding: .35rem; vertical-align: top; text-align: left; }
.bear-attendance-table input:not([type=checkbox]), .bear-attendance-table select { width: 100%; min-width: 6rem; }
.bear-attendance-table select { min-width: 12rem; }
.bear-attendance-table small { display: block; max-width: 24rem; overflow-wrap: anywhere; }
.bear-attendance-scroll { overflow-x: auto; }
.bear-attendance-trap details img { display: block; max-width: min(100%, 23rem); margin: .5rem 0; }
.bear-attendance-review { grid-template-columns: 39px minmax(6rem, 1fr); align-items: center; cursor: pointer; }
.bear-attendance-review .bear-attendance-verify { width: 39px; height: 39px; margin: 0; padding: 0; cursor: pointer; }

.bear-attendance-views { margin-block: .8rem 1.25rem; gap: .75rem; }
.bear-attendance-views [aria-pressed="true"] { background: #49374c; color: #fff4e9; }
.bear-attendance-date-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .75rem; }
.bear-attendance-date-controls > label { flex: 1 1 12rem; min-width: 0; }
.bear-attendance-date-controls > label, #bear-attendance-form input[name="huntTime"], [data-attendance-report] > label { max-width: 24rem; }
.bear-attendance-date-nav { display: flex; justify-content: space-between; gap: .75rem; margin-block: 1rem; }
.bear-attendance-date-nav > button { min-width: 0; }
#bear-attendance :is([data-hunt-schedule], [data-attendance-status], [data-attendance-report-status]) { margin-block: .8rem; }
#bear-attendance-form > fieldset, [data-attendance-report] > label { margin-block: 1rem; }
#bear-attendance-form > fieldset > p { margin-top: .8rem; }
.bear-attendance-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-block: 1rem; }
.bear-attendance-menu > div { display: flex; flex-direction: column; align-items: flex-start; }
.bear-attendance-menu > div > .bear-attendance-menu-card { flex: 1; width: 100%; }
@media (max-width: 720px) {
  .bear-attendance-menu { grid-template-columns: 1fr; }
}
.bear-attendance-menu-card { border: 1px solid var(--border); border-radius: .7rem; padding: 1rem; }
.bear-attendance-menu p { margin-block: .55rem .85rem; }
.bear-attendance-report-table :is(td, th):not(:first-child) { text-align: right; white-space: nowrap; }

.bear-attendance-times, .bear-attendance-report-dates { display: flex; flex-wrap: wrap; gap: .85rem; }
.bear-attendance-times > label, .bear-attendance-report-dates > label { flex: 1 1 12rem; max-width: 24rem; }
.bear-attendance-report-dates { margin-block: 1rem; }
.bear-attendance-report-dates > label { min-inline-size: 0; }
.bear-attendance-report-dates select { max-inline-size: 100%; }
@supports (appearance: base-select) {
  .bear-attendance-report-dates select::picker(select) {
    inline-size: max-content;
    min-inline-size: 0;
    overflow-x: hidden;
  }
  .bear-attendance-report-dates select option:enabled:hover { scale: 1; }
}

#player-editor-table [data-field="alternateNames"] { min-width: 14rem; }

.bear-attendance-times input[readonly] { background: #2d292c; color: var(--muted); cursor: default; }

.bear-attendance-trap-heading { position: relative; }
.bear-attendance-stamps {
  position: absolute;
  inset: 0 .15rem auto auto;
  display: grid;
  justify-items: end;
  gap: .35rem;
  pointer-events: none;
}
.bear-attendance-stamp {
  color: #8bd8a0;
  border: 4px double currentColor;
  border-radius: .25rem;
  padding: .3rem .6rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
  transform: rotate(-8deg);
}
.bear-attendance-menu .actions { flex-wrap: wrap; gap: .4rem; }
.bear-attendance-menu button[data-attendance-locked] { color: var(--muted); }
.bear-attendance-times { align-items: end; }
.bear-attendance-times [data-attendance-edit-time] { font-size: .85rem; padding: .45rem .25rem; text-decoration: underline; }
.bear-attendance-row-actions { margin-left: auto; justify-content: flex-end; }

.bear-attendance-proceed { margin-top: 1rem; }

.bear-attendance-reserved { visibility: hidden; }
[data-attendance-status] { min-block-size: 1lh; }

.bear-attendance-manual { width: min(calc(100% - 2rem), 53rem); }
.bear-attendance-manual .bear-attendance-scroll { max-height: min(48vh, 24rem); overflow: auto; }
.bear-attendance-manual h3 { margin-block: 0 .4rem; }
.bear-attendance-manual [role="status"]:not(:empty) { margin-top: .65rem; }
.bear-attendance-manual .actions { justify-content: flex-end; }
.bear-attendance-manual [data-attendance-manual-add] { margin-right: auto; }

.bear-attendance-scores-stamp { color: #ff8585; font-size: .8rem; padding: .2rem .5rem; transform: rotate(-5deg); }

.bear-hunt-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  margin: 0;
}
.bear-hunt-metrics :is(dt, dd) { margin: 0; padding: .35rem .6rem; background: #3a323d; }
.bear-hunt-metrics :is(dt, dd):nth-child(4n+3),
.bear-hunt-metrics :is(dt, dd):nth-child(4n+4) { background: #464356; }
.bear-hunt-metrics dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bear-hunts-history { min-width: 39rem; table-layout: fixed; border-collapse: separate; border-spacing: .55rem .4rem; }
.bear-hunts-history > thead th { color: var(--gold); }
.bear-hunts-history > tbody td { vertical-align: top; padding: 0; }
.bear-hunts-history-entry {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  min-height: 100%;
  border: 1px solid var(--border);
  border-radius: .5rem;
  overflow: hidden;
}
.bear-hunts-history-date { display: grid; align-content: center; gap: .15rem; padding: .55rem .6rem; }
.bear-hunts-history-date span { color: var(--muted); font-size: .78rem; }
.bear-hunts-history-entry > p { align-self: center; margin: 0; padding: .55rem; color: var(--muted); }

.bear-participation-actions { justify-content: space-between; margin-top: .6rem; }
.bear-participation-actions [data-participation-unhide] { padding: .35rem .15rem; font-size: .83rem; text-decoration: underline; }
.bear-participation-actions [data-participation-top] {
  margin-left: auto;
  padding: .55rem .9rem;
  border: 1px solid #a87662;
  border-radius: 1rem;
  color: #ffddb0;
  background: linear-gradient(112deg, #573241, #3b2b48);
}
.bear-top-sixteen {
  width: min(calc(100% - 2rem), 62rem);
  max-height: calc(100vh - 2rem);
  padding: clamp(.8rem, 2.5vw, 1.6rem);
  background: #271f2b;
  color: #f4ece2;
}
.bear-top-sixteen > header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.bear-top-sixteen h3 { margin: 0; }
.bear-top-sixteen [data-top-sixteen-range] { color: var(--muted); margin-block: .45rem 1rem; }
.bear-top-sixteen-photo { position: relative; margin: 0; }
.bear-top-sixteen-photo img {
  display: block;
  width: 100%;
  height: auto;
  mask-image: linear-gradient(to right, transparent, #000 5% 95%, transparent),
              linear-gradient(to bottom, transparent, #000 9% 87%, transparent);
  mask-composite: intersect;
}
.bear-top-sixteen-photo-names > div {
  position: absolute;
  transform: translate(-50%, 0);
  display: flex;
  align-items: center;
  gap: .23rem;
  max-width: 10%;
  padding: .12rem .3rem;
  border: 1px solid #f7ca8c80;
  border-radius: .6rem;
  background: #2b1b36ee;
  color: #fff4e9;
  font-size: clamp(.56rem, 1vw, .82rem);
  line-height: 1.2;
  white-space: nowrap;
}
.bear-top-sixteen-photo-names b, .bear-top-sixteen-lineup span { color: #ffd58b; font-variant-numeric: tabular-nums; }
.bear-top-sixteen-photo-names > div span { overflow: hidden; text-overflow: ellipsis; }
.bear-top-sixteen-photo-names > div:first-child { background: #614028; color: #ffebc5; }
.bear-top-sixteen-lineup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--lineup-rows), auto);
  grid-auto-flow: column;
  gap: .45rem .7rem;
  padding: .65rem 0 0;
  margin: 0;
  list-style: none;
}
.bear-top-sixteen-lineup li {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  padding: .35rem .55rem;
  border-radius: .45rem;
  background: #ffffff09;
  font-size: .86rem;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .bear-top-sixteen-photo-names > div span { display: none; }
}

.bear-top-sixteen-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.bear-top-sixteen-groups h4 { margin-block: .55rem .1rem; color: #ffd58b; }
.bear-top-sixteen-groups [data-trap="2"] h4,
.bear-top-sixteen-groups [data-trap="2"] .bear-top-sixteen-lineup span,
.bear-top-sixteen-photo-names > [data-trap="2"] b { color: #b5e5ff; }
.bear-top-sixteen-photo-names > [data-trap="2"] { background: #253e54ee; border-color: #b5e5ff80; }
@media (max-width: 530px) {
  .bear-top-sixteen-groups { grid-template-columns: 1fr; }
}
