/* Shared finishing touches. Game scenes keep their own colours and motion. */
:is(.chest-detail-close, .profile-modal-close, .student-close, .secret-close, .caravan-close, .desktop-hint .close-hint) {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 12px;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .16s, border-color .16s;
}
:is(.chest-detail-close, .profile-modal-close, .student-close, .secret-close, .caravan-close, .desktop-hint .close-hint)::before {
  content: '';
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
:is(.chest-detail-close, .profile-modal-close, .student-close, .secret-close, .caravan-close) {
  top: 12px;
  right: 12px;
  z-index: 8;
}
@media (hover: hover) {
  :is(.chest-detail-close, .profile-modal-close, .student-close, .secret-close, .caravan-close, .desktop-hint .close-hint):hover {
    background-color: color-mix(in srgb, currentColor 10%, transparent);
    border-color: currentColor;
  }
}
:is(.btn, .profile-tabs > button, .city-plot, .cosmetic-choice, .frame-choice, .chest-tile,
    .chest-detail-close, .profile-modal-close, .student-close, .secret-close, .caravan-close,
    .close-hint, .market-inventory, .forge-lever):focus-visible {
  outline: 3px solid var(--accent-bright, #74b3ff);
  outline-offset: 3px;
}
:is(.public-profile-modal, .chest-dialog, .secret-dialog) {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.public-profile-head { padding-right: 50px; align-items: flex-start; }
.public-profile-head > div:last-child { min-width: 0; }
.public-profile-head h2 { overflow-wrap: anywhere; }
.student-detail > :is(.eyebrow, h3) { padding-right: 48px; }
.secret-dialog h2 { padding-right: 44px; line-height: 1.3; }
.chest-detail-content { padding-top: 58px; }
.chest-detail-content h2 { line-height: 1.3; }
.chest-sale-dialog .chest-reveal { padding: 28px 24px; }
.chest-sale-dialog :is(.chest-sale-confirm, .chest-sale-cancel) { width: 100%; min-height: 46px; }
.forge-confirm-actions > .btn { min-height: 44px; }
.profile-pane-heading { margin-bottom: 22px; }
.profile-pane-heading h2 { margin-top: 6px; line-height: 1.25; }
.stats-screen > .profile-tabs > button { line-height: 1.35; }
.profile-pane :is(.collection-section, .forge-inventory) > div > p { line-height: 1.65; }
.profile-pane .profile-award { overflow-wrap: anywhere; }
:is(.chest-odds, .forge-rules, .city-council details, .award-archive) > summary {
  box-sizing: border-box;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
  line-height: 1.45;
}
:is(.chest-odds, .forge-rules, .city-council details, .award-archive) > summary::-webkit-details-marker { display: none; }
:is(.chest-odds, .forge-rules, .city-council details, .award-archive) > summary::after {
  content: '';
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin: -4px 3px 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
:is(.chest-odds, .forge-rules, .city-council details, .award-archive)[open] > summary::after {
  transform: rotate(225deg);
  margin-top: 4px;
}
:is(.chest-odds, .forge-rules, .city-council details, .award-archive) > summary:focus-visible {
  outline: 3px solid var(--accent-bright, #74b3ff);
  outline-offset: 2px;
}
.academy-purchase { display: grid; gap: 12px; }
.academy-purchase > button { width: 100%; min-height: 46px; margin: 0; white-space: normal; line-height: 1.4; }
.academy-price { align-items: center; gap: 12px; }
.city-heroes li { min-width: 0; }
.city-heroes li > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.academy-message:empty { min-height: 0; margin: 0; }
.profile-modal-loading .keyboard-loader { padding-inline: 0; }
@media (max-width: 600px) {
  .public-profile-modal { padding: 22px 18px; border-radius: 20px; }
  .public-profile-head { gap: 10px; padding-right: 46px; }
  .public-profile-avatar { width: 48px; height: 48px; border-radius: 15px; font-size: 1.5rem; }
  .public-profile-head h2 { font-size: 1.2rem; }
  .public-profile-kpis { gap: 8px; }
  .chest-detail-content { padding: 58px 20px 24px; }
  .profile-pane-heading { margin-bottom: 18px; }
  .forge-confirm-actions { display: grid; grid-template-columns: 1fr; }
  .forge-confirm-actions > .btn { width: 100%; white-space: normal; }
  .secret-dialog form > .btn { flex: 1 0 100%; min-height: 44px; }
  .secret-dialog input { flex-basis: 100%; }
  .caravan-event header { padding-top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.btn, .profile-tabs > button, .city-plot, .chest-detail-close, .profile-modal-close,
      .student-close, .secret-close, .caravan-close, .close-hint) { transition: none; }
  .boot-keyboard i { animation: none; opacity: .75; }
}

/* A personal contribution receipt: warm, legible and consistent with every palette. */
.toast.council-notice {
  box-sizing: border-box;
  width: min(460px, calc(100vw - 28px));
  max-width: min(460px, calc(100vw - 28px));
  max-height: calc(100dvh - 36px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid var(--warm-border, #d6b976);
  border-radius: 24px;
  background: linear-gradient(140deg, var(--warm-dim, #d6b97618), transparent 65%), var(--panel-elevated);
  color: var(--text-bright);
  box-shadow: inset 0 3px 0 var(--warm, #d6b976), var(--shadow);
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  animation: council-notice-arrive .26s ease-out both;
}
.council-notice-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) 36px; align-items: center; gap: 12px; }
.council-notice-seal { display: grid; place-items: center; color: var(--warm, #d6b976); }
.council-notice-kicker { display: block; color: var(--text); font-size: .62rem; letter-spacing: .11em; font-weight: 800; }
.council-notice-head h2 { margin: 5px 0 0; color: var(--text-bright); font-size: 1.26rem; font-weight: 850; line-height: 1.24; text-wrap: balance; }
.toast.council-notice .council-notice-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  margin: 0;
  padding: 0;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0;
  line-height: 1;
  touch-action: manipulation;
}
.council-notice-close::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.council-notice-intro { margin: 16px 0 14px; color: var(--text); font-size: .84rem; }
.council-notice-receipt { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); align-items: center; gap: 8px; padding: 16px 10px; border: 1px solid var(--warm-border); border-radius: 17px; background: var(--bg-soft); }
.council-notice-amount { display: grid; justify-items: center; min-width: 0; gap: 3px; }
.council-notice-amount svg { color: var(--warm); }
.council-notice-amount strong { max-width: 100%; color: var(--text-bright); font-size: clamp(1.2rem, 5.5vw, 1.9rem); font-weight: 850; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.council-notice-amount > span { color: var(--text); font-size: .7rem; text-align: center; }
.council-notice-arrow { color: var(--warm); font-size: 1.35rem; text-align: center; }
.council-notice-detail { margin: 11px 0 17px; color: var(--text); font-size: .75rem; text-align: center; }
.council-notice-footer { display: flex; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.council-notice-protection { display: flex; align-items: center; min-width: 0; gap: 7px; color: var(--text); font-size: .72rem; }
.council-notice-protection svg { flex: 0 0 20px; color: var(--success-bright, var(--text)); }
.toast.council-notice .council-notice-confirm { flex: 0 0 auto; margin: 0 0 0 auto; padding: 11px 17px; min-height: 42px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: .82rem; font-weight: 800; touch-action: manipulation; }
.toast.council-notice button:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 3px; }
@media (hover: hover) { .toast.council-notice button:hover { filter: brightness(1.08); } }
@keyframes council-notice-arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 420px) {
  .toast.council-notice { padding: 18px; border-radius: 21px; }
  .council-notice-head { grid-template-columns: 44px minmax(0, 1fr) 36px; gap: 8px; }
  .council-notice-seal svg { width: 44px; height: 44px; }
  .council-notice-kicker { font-size: .56rem; letter-spacing: .09em; }
  .council-notice-head h2 { font-size: 1.12rem; }
  .council-notice-footer { gap: 9px; }
  .council-notice-protection { font-size: .68rem; }
  .toast.council-notice .council-notice-confirm { padding-inline: 13px; }
}
@media (prefers-reduced-motion: reduce) { .toast.council-notice { animation: none; } }
