:root {
  color-scheme: light;
  --app-bg: #f3f6f4;
  --app-ink: #192c24;
  --app-muted: #586b61;
  --app-panel: #fff;
  --app-line: #e0e8e3;
  --app-primary: #0f5132;
  --app-primary-dark: #0a3d26;
  --app-action: var(--app-primary);
  --app-action-hover: var(--app-primary-dark);
  --app-soft: #f3f7f4;
  --app-tint: #eaf3ed;
  --app-quiet: #f5f8f6;
  --app-control-border: #bacac0;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #101b16;
  --app-ink: #e5f0e9;
  --app-muted: #afc2b6;
  --app-panel: #192923;
  --app-line: #395247;
  --app-primary: #90d8ae;
  --app-primary-dark: #b8edca;
  --app-action: #17643f;
  --app-action-hover: #1d774b;
  --app-soft: #1c2e25;
  --app-tint: #243e31;
  --app-quiet: #20342a;
  --app-control-border: #648374;
  --bs-primary-rgb: 144, 216, 174;
  --bs-secondary-rgb: 175, 194, 182;
  --bs-success-rgb: 129, 216, 162;
  --bs-danger-rgb: 255, 154, 163;
}

[data-theme="dark"] :is(.card, .modal-content, .offcanvas, .dropdown-menu, .list-group-item) {
  color: var(--app-ink);
  background-color: var(--app-panel);
  border-color: var(--app-line);
}

[data-theme="dark"] :is(.card-header, .card-footer, .modal-header, .modal-footer, .dropdown-divider, .border, hr) {
  border-color: var(--app-line) !important;
}

[data-theme="dark"] :is(.form-control, .form-select, .input-group-text) {
  color: var(--app-ink);
  background-color: var(--app-bg);
  border-color: var(--app-control-border);
}

[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23afc2b6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="dark"] :is(.form-control, .form-select):focus { border-color: var(--app-primary); box-shadow: 0 0 0 .22rem #90d8ae38; }
[data-theme="dark"] :is(.form-control:disabled, .form-control[readonly], .form-select:disabled) { background-color: var(--app-tint); }
[data-theme="dark"] .form-control::placeholder { color: var(--app-muted); }
[data-theme="dark"] input::file-selector-button { color: var(--app-ink); background: var(--app-tint); }
[data-theme="dark"] .form-check-input { background-color: var(--app-bg); border-color: var(--app-control-border); }
[data-theme="dark"] .form-check-input:checked { background-color: var(--app-action); border-color: var(--app-primary); }
[data-theme="dark"] .table {
  color: var(--app-ink);
  border-color: var(--app-line);
  --bs-table-striped-color: var(--app-ink);
  --bs-table-striped-bg: var(--app-soft);
  --bs-table-hover-color: var(--app-ink);
  --bs-table-hover-bg: var(--app-tint);
}

[data-theme="dark"] :is(.text-muted, .form-text) { color: var(--app-muted) !important; }
[data-theme="dark"] :is(.dropdown-item, .navbar-light .navbar-nav .nav-link) { color: var(--app-ink); }
[data-theme="dark"] :is(.dropdown-item:hover, .dropdown-item:focus, .navbar-light .navbar-nav .nav-link:hover) { background: var(--app-tint); color: var(--app-primary-dark); }
[data-theme="dark"] .navbar-light .navbar-toggler { color: var(--app-primary); border-color: var(--app-line); }
[data-theme="dark"] .btn-close:not(.btn-close-white) { filter: invert(1); }
[data-theme="dark"] .btn-outline-secondary { color: var(--app-muted); border-color: var(--app-control-border); }
[data-theme="dark"] .btn-outline-secondary:hover { background: var(--app-tint); color: var(--app-ink); }
[data-theme="dark"] .btn-outline-danger { color: #ff9aa3; border-color: #e8838d; }
[data-theme="dark"] .btn-outline-danger:hover { background: #a3293a; color: #fff; }
[data-theme="dark"] .alert-warning { color: #ffe5a9; background: #402f15; border-color: #785b2b; }
[data-theme="dark"] .alert-success { color: #c8eed7; background: #193727; border-color: #3f6f52; }
[data-theme="dark"] .alert-info { color: #bde8ff; background: #183646; border-color: #3c718b; }
[data-theme="dark"] :focus-visible { outline-color: var(--app-primary); }

.text-bg-light { color: var(--app-ink); background: var(--app-tint); }
.text-bg-secondary { color: #fff; background: #5d6b63; }
.text-bg-success { color: #fff; background: #17643f; }
.text-bg-danger { color: #fff; background: #a3293a; }
.text-bg-warning { color: #30200c; background: #ffd66b; }
.text-bg-info { color: #14252f; background: #abdef3; }

[data-theme="dark"] .badge.bg-secondary { background: #52645a !important; }
[data-theme="dark"] .badge.bg-success { background: #246443 !important; }
[data-theme="dark"] .badge.bg-warning { background: #ffd66b !important; }
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  color: var(--app-ink);
  background: var(--app-bg);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.app-toast-container { position: fixed; top: max(.75rem, env(safe-area-inset-top)); right: max(.75rem, env(safe-area-inset-right)); z-index: 1090; width: min(26rem, calc(100vw - 1.5rem)); pointer-events: none; }
.app-toast { width: 100%; color: var(--app-ink); background: var(--app-panel); border: 1px solid var(--app-line); border-left: 6px solid var(--app-primary); box-shadow: 0 6px 24px #192c2429; pointer-events: auto; overflow-wrap: anywhere; font-size: 1rem; }
.app-toast-error { border-left-color: #b02a37; }
.app-toast .toast-header { color: var(--app-ink); background: transparent; }
.app-toast .btn-close { min-width: 32px; min-height: 32px; margin: 0 -.25rem 0 .5rem; }
.app-toast .toast-body { padding: .85rem; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 1045;
  background: var(--app-panel);
  border-bottom: 1px solid var(--app-line);
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-link {
  color: var(--app-ink);
  font-weight: 600;
}

.page-shell {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.hero-panel,
.app-card,
.notice-box {
  border: 1px solid var(--app-line);
  border-radius: 20px;
  background: var(--app-panel);
  box-shadow: 0 6px 24px rgba(24, 33, 25, 0.035);
}

.hero-panel {
  padding: 2.5rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.5fr 1fr;
}

.hero-panel h1,
.page-header h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-actions,
.stats-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid div,
.notice-box,
.leader-item {
  padding: 1rem;
  border-radius: 18px;
  background: var(--app-panel);
}

.stats-grid strong {
  display: block;
  font-size: 1.6rem;
}

.section-kicker,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--app-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.leader-list {
  display: grid;
  gap: 0.9rem;
}

.leader-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leader-item p,
.page-header p,
.hero-panel p {
  margin: 0;
  color: var(--app-muted);
}

.page-header,
.narrow {
  max-width: 780px;
}

.page-header {
  margin-bottom: 2rem;
}

.attendance-list,
.history-list,
.vote-result-list {
  display: grid;
  gap: 0.85rem;
}

.attendance-item,
.history-item,
.vote-result-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: var(--app-panel);
}

.team-card {
  min-height: 600px;
  padding: 1.25rem;
  border-radius: 22px;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.team-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-grid-4 .team-roster-head,
.team-grid-4 .team-player-row {
  grid-template-columns: minmax(82px, 1.5fr) minmax(64px, 1fr) repeat(2, minmax(20px, 0.35fr)) minmax(52px, 0.75fr);
  column-gap: 0.25rem;
  font-size: 0.72rem;
}

.team-grid-4 .team-roster-head {
  font-size: 0.58rem;
}

.team-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.team-average {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-weight: 800;
}

.team-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
}

.team-achievement {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-weight: 800;
}

.champion-achievement { background: #ffe08a; color: #5c3b00; }
.relegated-achievement { background: #a52a2a; color: #fff5e6; }

.team-record { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.55rem; }
.team-record strong { font-size: 1.5rem; }

.team-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  margin: 1rem 0;
}

.team-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.1rem;
  padding: 0.2rem 0.15rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  text-align: center;
}

.team-stats dt {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
}

.team-stats dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.team-champion {
  border: 4px solid #fff2a8;
  box-shadow: 0 0 20px #fff2a8, 0 0 48px rgba(255, 210, 72, 0.9), inset 0 0 58px rgba(255, 252, 203, 0.32);
  animation: champion-glow 2s ease-in-out infinite alternate;
}

.team-relegated {
  border-style: dashed;
  box-shadow: inset 0 0 35px rgba(74, 16, 16, 0.55), 0 7px 0 rgba(77, 34, 11, 0.42);
  filter: saturate(0.82);
}

@keyframes champion-glow { to { box-shadow: 0 0 28px #fff8c7, 0 0 66px rgba(255, 217, 84, 1), inset 0 0 66px rgba(255, 255, 221, 0.42); } }

.manual-swap {
  padding: 1rem;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: var(--app-panel);
}

.team-roster {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.team-roster-head,
.team-player-row {
  display: grid;
  grid-template-columns: minmax(130px, 2fr) minmax(110px, 1.35fr) repeat(2, minmax(30px, 0.45fr)) minmax(78px, 0.9fr);
  align-items: center;
  column-gap: 0.4rem;
}

.team-roster-head {
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.team-player-row {
  min-height: 52px;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.correction-goal { scroll-margin-top: calc(var(--app-header-height, 6rem) + 1rem); }

.vote-result-item {
  align-items: center;
}

.vote-result-item > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.vote-result-count {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--app-primary-dark);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vote-result-winner {
  color: #4b3500;
  background: linear-gradient(135deg, #fff1a8, #ffd66b);
  border: 2px solid #e3ac1a;
  box-shadow: 0 8px 20px rgba(184, 125, 0, 0.18);
}

@media (max-width: 1199.98px) {
  .team-grid,
  .team-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-footer {
  padding: 1rem 0 2rem;
  color: var(--app-muted);
}

.app-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--app-line);
  padding-top: 1rem;
}

.btn-primary {
  background-color: var(--app-action);
  border-color: var(--app-action);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--app-action-hover);
  border-color: var(--app-action-hover);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--app-ink);
}

@media (max-width: 991.98px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .attendance-item,
  .history-item,
  .vote-result-item {
    flex-direction: column;
  }

  .app-footer .container {
    flex-direction: column;
  }

  .team-grid,
  .team-grid-4 {
    grid-template-columns: 1fr;
  }

  .team-card {
    padding: 0.9rem;
  }

  .team-roster-head,
  .team-player-row {
    grid-template-columns: minmax(72px, 1.45fr) minmax(56px, 0.9fr) repeat(2, minmax(22px, 0.3fr)) minmax(54px, 0.7fr);
    column-gap: 0.25rem;
    font-size: 0.75rem;
  }

  .team-roster-head {
    font-size: 0.6rem;
  }
}

/* Shared navigation: one set of links for desktop and the mobile drawer. */
a { color: var(--app-primary); }
a:hover { color: var(--app-primary-dark); }
:focus-visible { outline: 3px solid #237b55; outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 1080; padding: .75rem 1rem; background: var(--app-panel); border-radius: 8px; }
.skip-link:focus { top: .5rem; }
.app-header .navbar { min-height: 76px; padding: .6rem 0; }
.app-header .navbar > .container { gap: .6rem; }
.app-header .navbar-brand { color: var(--app-primary); font-size: 1.15rem; letter-spacing: -.025em; margin-right: .75rem; }
.app-header .navbar-brand { text-transform: none; }
.brand-logo { display: block; width: 180px; height: 60px; object-fit: contain; }
.menu-brand-logo { display: block; width: min(210px, 100%); height: 70px; object-fit: contain; margin-bottom: .5rem; }
.app-menu-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--app-line); border-radius: 12px; color: var(--app-primary); padding: .5rem; }
.primary-navigation .nav-link { display: flex; align-items: center; gap: .8rem; border-radius: 10px; }
.primary-navigation .nav-link:hover, .primary-navigation .nav-link[aria-current="page"] { color: var(--app-primary); background: var(--app-tint); }
.navigation-icon { flex-shrink: 0; }
.account-toggle { display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.account-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--app-tint); color: var(--app-primary); }
.account-identity { display: grid; gap: .25rem; padding: .75rem 1rem; margin-bottom: .4rem; border-bottom: 1px solid var(--app-line); }
.account-identity span { color: var(--app-muted); font-size: .8rem; }
.account-identity strong { font-size: .875rem; overflow-wrap: anywhere; }
.account-navigation .dropdown-menu { border: 1px solid var(--app-line); border-radius: 14px; min-width: 280px; max-width: min(360px, 90vw); box-shadow: 0 12px 32px #192c2414; }
.account-navigation .dropdown-item { white-space: normal; padding: .7rem 1rem; }
.account-navigation .dropdown-item:active { background: var(--app-action); color: #fff; }
.theme-selector { position: relative; }
.theme-toggle { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.theme-toggle::after { content: ""; flex: 0 0 .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.theme-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
.theme-selector-public .theme-toggle { border: 0; background: transparent; text-align: start; }
.theme-options { margin: 0; padding: .25rem 0; list-style: none; background: var(--app-soft); }
.theme-options .dropdown-item { position: relative; padding-inline: 1.8rem 2rem; }
.theme-options .dropdown-item[aria-pressed="true"] { color: var(--app-primary); font-weight: 700; }
.theme-options [aria-pressed="true"] .theme-check::after { content: "✓"; position: absolute; inset-inline-end: .8rem; }
@media (min-width: 1200px) {
    .account-navigation { align-items: center; }
    .account-navigation .dropdown-menu { max-height: calc(100dvh - 6rem); overflow-y: auto; }
    .theme-selector-public .theme-options { position: absolute; top: 100%; inset-inline-end: 0; width: max-content; min-width: 12.5rem; border: 1px solid var(--app-line); border-radius: .75rem; box-shadow: 0 12px 32px #192c2424; }
    .theme-selector-public .theme-options .dropdown-item { padding-inline-start: 1rem; white-space: nowrap; }
}
.account-profile-menu > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.account-profile-menu > summary::-webkit-details-marker { display: none; }
.account-profile-menu > summary::after { content: ""; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-inline-end: .25rem; }
.account-profile-menu[open] > summary::after { transform: rotate(225deg); }
.account-profile-menu > ul { background: var(--app-soft, #f3f7f4); }
.account-profile-menu > ul .dropdown-item { padding-inline-start: 1.8rem; }
.player-profile-info { display: grid; grid-template-columns: minmax(9rem, 11rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.player-profile-portrait { display: grid; justify-items: start; gap: .75rem; min-width: 0; }
.player-profile-photo { display: grid; place-items: center; width: min(100%, 10rem); aspect-ratio: 1; border: 1px solid var(--app-line); border-radius: 50%; background: var(--app-tint); color: var(--app-primary); }
.player-photo-image { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.player-photo-placeholder { display: block; width: 58%; aspect-ratio: 1; opacity: .85; background: radial-gradient(circle at 50% 30%, currentColor 0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, currentColor 0 50%, transparent 51%) 50% 60% / 90% 67% no-repeat; border-radius: 50%; }
.profile-photo-editor { width: 100%; }
.profile-photo-editor > summary { list-style: none; }
.profile-photo-editor > summary::-webkit-details-marker { display: none; }
.profile-photo-editor form { margin-top: .55rem; }
.profile-photo-editor form[data-profile-photo-form] { display: grid; gap: .35rem; }
.profile-photo-editor .form-label { margin-bottom: 0; }
.player-profile-facts { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); column-gap: .9rem; row-gap: .45rem; }
.player-profile-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 575px) {
    .player-profile-info { grid-template-columns: 1fr; gap: 1.25rem; }
    .player-profile-portrait { justify-items: center; }
    .profile-photo-editor { max-width: 16rem; }
}
.group-context > strong { overflow-wrap: anywhere; }
.group-context .btn { min-height: 44px; display: inline-flex; align-items: center; border-color: var(--app-control-border); color: var(--app-primary); border-radius: 10px; }
.btn { border-radius: 10px; font-weight: 600; }
.btn-outline-primary { color: var(--app-primary); border-color: var(--app-primary); }
.btn-outline-primary:hover, .btn-outline-primary:active { background-color: var(--app-action); border-color: var(--app-action); }
.home-hero { background: linear-gradient(115deg, #0b3928, #176345); border: none; color: #fff; padding: 2.5rem; align-items: center; position: relative; overflow: hidden; }
.home-hero::before { content: ""; position: absolute; width: 340px; height: 340px; right: -180px; top: -140px; border: 1px solid #ffffff20; border-radius: 50%; pointer-events: none; }
.home-hero > div { position: relative; min-width: 0; }
.home-hero .eyebrow { color: #b6e6c9; }
.home-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: .6rem 0 .9rem; overflow-wrap: anywhere; }
.home-hero p { color: #e0eee5; line-height: 1.65; max-width: 520px; }
.home-hero .hero-actions { gap: .75rem; max-width: 320px; width: 100%; justify-self: end; }
.home-hero .btn-primary { background: #fff; color: #0b3928; border-color: #fff; }
.home-hero .btn-primary:hover { background: #e4f1e8; }
.home-hero .btn-primary span { margin-left: .75rem; }
.home-hero .btn-outline-light { color: #fff; border-color: #ffffff70; }
.home-hero .btn-outline-light:hover { color: #0b3928; background: #fff; }
.home-hero .btn { min-height: 50px; font-size: 1rem; }
.app-card .card-body { padding: 1.5rem; }
.empty-encounter .btn { min-height: 44px; }
.leader-item { background: var(--app-quiet); gap: 1rem; }
.leader-item p { font-size: .9rem; margin-top: .25rem; }
.leader-value { color: var(--app-primary); font-size: 1.15rem; font-weight: 800; flex-shrink: 0; }
.notice-box { box-shadow: none; height: 100%; background: var(--app-quiet); color: var(--app-muted); font-size: .9rem; line-height: 1.65; }
.stats-grid > div { background: var(--app-soft); padding: 1rem .5rem; text-align: center; }
.stats-grid span { font-size: .85rem; color: var(--app-muted); }
.stats-grid strong { color: var(--app-primary); }

@media (min-width: 1200px) {
  .app-menu-toggle, .menu-group { display: none; }
  .primary-navigation .navigation-icon { display: none; }
  .app-header .nav-link { font-size: .82rem; padding: .6rem .55rem; }
  .app-header .offcanvas-body { gap: .5rem; align-items: center; }
  #installAppButton { font-size: .75rem; white-space: nowrap; }
  .leader-list-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1199.98px) {
  .app-header .navbar > .container { justify-content: flex-start; }
  .app-header .navbar-brand { margin-right: 0; }
  .app-navigation { width: min(340px, 90vw); }
  .app-navigation .offcanvas-header { padding: 1.5rem; background: #0b3928; color: #fff; gap: 1rem; }
  .menu-eyebrow { display: block; color: #b6e6c9; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem; }
  .app-navigation .btn-close { min-width: 24px; min-height: 24px; padding: .6rem; opacity: 1; }
  .app-navigation .offcanvas-body { padding: 1rem; }
  .menu-group { display: grid; gap: .4rem; margin: .5rem .75rem 1.25rem; }
  .menu-group strong { overflow-wrap: anywhere; }
  .primary-navigation { gap: .25rem; }
  .primary-navigation .nav-link { padding: .85rem .9rem; min-height: 48px; }
  .account-navigation { border-top: 1px solid var(--app-line); margin-top: 1rem; padding-top: .75rem; }
  .account-toggle { padding: .5rem .75rem; }
  .theme-selector-public .theme-toggle { width: 100%; min-height: 44px; }
  .account-navigation .dropdown-menu { position: static !important; transform: none !important; min-width: 0; max-width: 100%; box-shadow: none; margin-top: .5rem !important; }
  #installAppButton { width: 100%; margin-top: 1rem; min-height: 44px; }
}
@media (max-width: 991.98px) {
  .home-hero .hero-actions { max-width: none; justify-self: stretch; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767.98px) {
  .app-header .navbar { min-height: 68px; }
  .brand-logo { width: 210px; height: 70px; }
  .page-shell { padding-top: 1.25rem; padding-bottom: 2rem; }
  .home-hero { padding: 1.5rem; gap: 1.5rem; }
  .home-hero .hero-actions { grid-template-columns: 1fr; }
  .app-card .card-body { padding: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .stats-grid span { font-size: .75rem; }
  .empty-encounter .btn { width: 100%; }
  .form-control, .form-select { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .offcanvas, .offcanvas-backdrop { transition: none; }
  .team-champion { animation: none; }
}

.pelada-transition { border: 1px solid var(--app-line); border-radius: 28px; padding: 2rem 1.5rem 1rem; width: min(420px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; color: var(--app-ink); background: var(--app-panel); text-align: center; box-shadow: 0 24px 80px #0b392840; }
.pelada-transition::backdrop { background: #0b251dcc; }
.papi-stage { position: relative; display: grid; place-items: center; margin-bottom: 1.25rem; }
.papi-halo { position: absolute; width: 200px; height: 200px; border-radius: 50%; background: var(--app-tint); box-shadow: 0 0 0 12px var(--app-soft); }
.papi-mascot { position: relative; object-fit: contain; max-width: 100%; animation: papi-greeting 1.6s ease-in-out infinite; }
.papi-name { position: relative; margin-top: -.35rem; border-radius: 999px; background: #0b3928; color: #fff; padding: .35rem .9rem; font-size: .8rem; font-weight: 700; }
.pelada-transition h2 { font-size: 1.55rem; font-weight: 800; line-height: 1.25; letter-spacing: -.025em; margin-bottom: 1rem; }
.pelada-transition-status { display: flex; justify-content: center; align-items: center; gap: .65rem; color: var(--app-muted); font-size: .9rem; overflow-wrap: anywhere; }
.pelada-transition-status > span:last-child { min-width: 0; }
.pelada-spinner { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 3px solid #deebe2; border-top-color: var(--app-primary); animation: pelada-spin .8s linear infinite; }
.pelada-transition-cancel { min-height: 44px; margin-top: .65rem; color: var(--app-primary); text-decoration: none; }
.pelada-transition-cancel:focus { box-shadow: none; }
.ranking-loading-progress { height: .65rem; margin: 0 auto; width: min(16rem, 100%); overflow: hidden; border-radius: 999px; background: var(--app-tint); }
.ranking-loading-progress > span { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--app-primary); animation: ranking-progress 1.15s ease-in-out infinite; }
@keyframes pelada-spin { to { transform: rotate(360deg); } }
@keyframes papi-greeting { 50% { transform: translateY(-5px) rotate(-1deg); } }
@keyframes ranking-progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .papi-mascot, .pelada-spinner, .ranking-loading-progress > span { animation: none; } }

.password-visibility-toggle { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.password-input { flex-wrap: nowrap; }
