:root {
  --bg-top: #1b1029;
  --bg-bottom: #0d1726;
  --card: rgba(17, 24, 39, 0.82);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-main: #f5f7fb;
  --text-muted: #d2dcec;
  --accent: #ff7a18;
  --accent-strong: #ff953f;
  --success: #18c07a;
  --danger: #ff5f7a;
  --draw: #8cb4ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 24, 0.22), transparent 32%),
    radial-gradient(circle at top right, rgba(66, 133, 244, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.app-shell,
.app-shell p,
.app-shell h1,
.app-shell h2,
.app-shell h3,
.app-shell h4,
.app-shell h5,
.app-shell h6,
.app-shell label {
  color: var(--text-main);
}

.app-shell {
  --app-shell-top-padding: 0rem;
  --app-shell-side-padding: 0rem;
  width: min(100%, 36rem);
  margin: 0 auto;
  padding: var(--app-shell-top-padding) var(--app-shell-side-padding) 2rem;
  position: relative;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.card,
.hero-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  backdrop-filter: blur(18px);
  color: var(--text-main);
}

.hero-card {
  margin-top: 0;
}

.account-menu-button {
  position: absolute;
  top: calc(var(--app-shell-top-padding) + 0.25rem);
  right: var(--app-shell-side-padding);
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(17, 24, 39, 0.78);
  color: var(--text-main);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(4, 9, 18, 0.28);
  z-index: 20;
}

.account-menu-button:hover,
.account-menu-button:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(24, 33, 49, 0.9);
}

.account-menu-avatar {
  width: 2.1rem;
  height: 2.1rem;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--player-avatar-ring, linear-gradient(135deg, rgba(255, 122, 24, 0.3), rgba(255, 255, 255, 0.08)));
  color: var(--player-avatar-text, #1a1410);
}

.account-menu-avatar-core {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--player-avatar-fill, linear-gradient(135deg, rgba(255, 122, 24, 0.9), rgba(255, 149, 63, 0.78)));
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.account-menu-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.player-avatar-shell {
  width: 1.7rem;
  height: 1.7rem;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--player-avatar-ring, linear-gradient(135deg, rgba(255, 122, 24, 0.3), rgba(255, 255, 255, 0.08)));
  flex: 0 0 auto;
}

.player-avatar-core {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--player-avatar-fill, linear-gradient(135deg, rgba(255, 122, 24, 0.9), rgba(255, 149, 63, 0.76)));
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--player-avatar-text, #1a1410);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.display-title {
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--text-main) !important;
}

.section-title {
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-main) !important;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: #ffd8bc;
}

.small-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main) !important;
}

.form-label,
.fw-bold,
.summary-card h3,
.stat-tile strong {
  color: var(--text-main) !important;
}

#screen-match .shared-info-grid .form-label {
  color: rgba(245, 247, 251, 0.82) !important;
}

.text-secondary,
.small.text-secondary {
  color: var(--text-muted) !important;
}

.small,
small,
.card-body .small,
.card-body small {
  color: var(--text-muted);
}

.admin-tools {
  padding-top: 0.25rem;
}

#remove-event-select,
#remove-location-select,
#remove-opponent-select {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-main) !important;
  border-color: rgba(255, 255, 255, 0.1);
}

.auth-stack {
  display: grid;
  gap: 1rem;
}

.auth-card {
  padding: 1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider {
  position: relative;
  margin: 1rem 0 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  position: relative;
  padding: 0 0.85rem;
  background: rgba(17, 24, 39, 0.92);
}

.auth-actions {
  display: grid;
  gap: 0.75rem;
}

.auth-inline-action {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.35rem;
  margin-bottom: 0.75rem;
}

.auth-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffd8bc;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.auth-link-button:hover,
.auth-link-button:focus-visible {
  color: #ffe6d2;
}

.auth-modal .auth-card {
  padding: 0;
  background: transparent;
  border: 0;
}

.auth-modal .auth-divider span {
  background: rgba(17, 24, 39, 0.98);
}

.profile-style-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-style-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.account-style-avatar {
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
}

.account-style-avatar .player-avatar-core {
  font-size: 0.88rem;
}

.profile-style-copy {
  min-width: 0;
}

.profile-style-group + .profile-style-group {
  margin-top: -0.2rem;
}

.profile-color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.profile-color-input {
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.profile-color-input::-webkit-color-swatch-wrapper {
  padding: 0.3rem;
}

.profile-color-input::-webkit-color-swatch {
  border: 0;
  border-radius: 0.72rem;
}

.profile-color-input::-moz-color-swatch {
  border: 0;
  border-radius: 0.72rem;
}

.profile-color-value {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: 0;
  color: #1a1410;
  font-weight: 700;
  border-radius: 1rem;
  padding-block: 0.9rem;
}

.btn-accent:hover,
.btn-accent:focus {
  background: linear-gradient(135deg, #ff8a2d, #ffaa61);
  color: #1a1410;
}

.btn-outline-light {
  border-radius: 1rem;
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text-main);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.btn-outline-danger {
  border-radius: 1rem;
  border-color: rgba(255, 95, 122, 0.42);
  color: #ffc6d0;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  border-color: rgba(255, 95, 122, 0.62);
  background: rgba(255, 95, 122, 0.08);
  color: #ffd6dd;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main) !important;
  border-radius: 1rem;
}

.required-field {
  border-color: rgba(255, 149, 63, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 149, 63, 0.08);
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 149, 63, 0.9);
  box-shadow: 0 0 0 0.2rem rgba(255, 149, 63, 0.2);
}

.form-select option,
.form-select optgroup {
  color: #111827;
}

.form-control::placeholder,
textarea.form-control::placeholder,
input.form-control::placeholder {
  color: rgba(210, 220, 236, 0.55);
}

.ts-wrapper.single .ts-control,
.ts-wrapper.single.input-active .ts-control {
  background: transparent;
  border: 0;
  color: var(--text-main);
  border-radius: 0;
  box-shadow: none;
  min-height: auto;
  padding: 0;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.single.focus .ts-control {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.ts-wrapper.required-rich-select .ts-control {
  border-color: rgba(255, 149, 63, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 149, 63, 0.08);
}

.ts-wrapper.single .ts-control:after {
  border-color: rgba(255, 216, 188, 0.95) transparent transparent;
  right: 0.15rem;
}

.ts-wrapper.single.dropdown-active .ts-control:after {
  border-color: transparent transparent rgba(255, 216, 188, 0.95);
  margin-top: -7px;
}

.ts-wrapper .ts-control > input {
  color: var(--text-main);
}

.ts-wrapper.single .ts-control .item {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text-main);
}

.ts-wrapper.single .ts-control .item,
.ts-wrapper.single .ts-control .item.active {
  background: transparent;
}

.ts-wrapper.single {
  display: flex;
  align-items: center;
  min-height: calc(2.75rem + 2px);
  padding-right: 1.2rem;
}

#screen-match .ts-wrapper.single {
  min-height: 38px;
  padding: 0 0.5rem;
}

#screen-match .ts-wrapper.single .ts-control {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
}

.ts-wrapper.single .ts-control .item .rich-item,
.ts-wrapper.single .ts-control .item .rich-option,
.rich-item,
.rich-item-colors,
.rich-item-set {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.ts-dropdown,
.ts-dropdown.form-control,
.ts-dropdown.form-select {
  background: rgba(17, 24, 39, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  color: var(--text-main);
  overflow: hidden;
}

.ts-dropdown .option,
.ts-dropdown .active {
  background: transparent;
  color: inherit;
}

.ts-dropdown .active {
  background: rgba(255, 149, 63, 0.14);
}

.ts-dropdown .optgroup-header {
  background: transparent;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 600;
  padding: 0.38rem 0.75rem;
}

.rich-option,
.rich-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rich-option-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.rich-option-title {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.1;
}

.rich-option-subtitle {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.15;
}

.set-symbol,
.set-symbol-fallback {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
}

.set-symbol {
  filter: brightness(0) invert(1);
  object-fit: contain;
}

.set-symbol-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
}

.mana-symbol-stack {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.mana-symbol {
  width: 1.1rem;
  height: 1.1rem;
  object-fit: contain;
}

.mana-pip {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.mana-pip.white {
  background: #f6f0d6;
  color: #3a3223;
}

.mana-pip.blue {
  background: #8fd3ff;
  color: #0f3554;
}

.mana-pip.black {
  background: #3c4455;
  color: #f5f7fb;
}

.mana-pip.red {
  background: #ff9d7d;
  color: #4a1c12;
}

.mana-pip.green {
  background: #90d09c;
  color: #153b1f;
}

.mana-pip.generic {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.rich-item-colors {
  min-height: 1.2rem;
  gap: 0.45rem;
}

.rich-item-label {
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.3);
  opacity: 1;
  cursor: pointer;
}

.select-wrap {
  position: relative;
}

.has-caret {
  padding-right: 3.25rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.select-wrap.no-caret .select-caret {
  display: none;
}

.select-caret {
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.8rem;
  height: 0.8rem;
  border-right: 2px solid rgba(255, 216, 188, 0.95);
  border-bottom: 2px solid rgba(255, 216, 188, 0.95);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 140ms ease;
  pointer-events: none;
}

.select-wrap.open .select-caret {
  transform: translateY(-35%) rotate(225deg);
}

.pod-select-wrap .select-caret {
  right: 0.75rem;
  width: 0.65rem;
  height: 0.65rem;
}

#pod-select {
  padding-left: 0.8rem;
}

#pod-select.has-caret {
  padding-right: 2rem;
}

.pod-select-wrap.no-caret #pod-select {
  padding-right: 0.8rem;
}

.pod-select-wrap.locked-select {
  pointer-events: none;
}

.pod-select-wrap.locked-select #pod-select {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-main) !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.topbar {
  min-height: 3.5rem;
  padding: 0.25rem 0.2rem 0.75rem;
}

.topbar-spacer {
  pointer-events: none;
}

.account-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 1rem;
}

.account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(6px);
}

.account-modal {
  position: relative;
  width: min(100%, 36rem);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  padding: 1.35rem;
  z-index: 1;
}

.account-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.account-modal-close {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 1.4rem;
  line-height: 1;
}

.account-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.account-modal-section + .account-modal-section {
  margin-top: 1rem;
}

.account-form-stack {
  display: grid;
  gap: 0.75rem;
}

.account-note {
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.account-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

body.account-modal-open {
  overflow: hidden;
}

.back-link {
  color: #ffd8bc;
  text-decoration: none;
  font-weight: 500;
}

.action-row {
  display: grid;
  gap: 0.75rem;
}

.auth-google-launch {
  display: grid;
  gap: 0.9rem;
}

.auth-launch-divider {
  position: relative;
  text-align: center;
}

.auth-launch-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-launch-divider span {
  position: relative;
  display: inline-block;
  padding: 0 0.85rem;
  background: rgba(17, 24, 39, 0.82);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-primary-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.welcome-banner {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 1rem 1.1rem;
  border-radius: 1.2rem;
  background:
    radial-gradient(circle at top left, rgba(255, 160, 80, 0.18), transparent 48%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.welcome-avatar {
  width: 3.35rem;
  height: 3.35rem;
  flex: 0 0 3.35rem;
}

.welcome-avatar .player-avatar-core {
  font-size: 1rem;
  font-weight: 800;
}

.welcome-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.welcome-kicker {
  color: #ffd8bc;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-heading-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.18rem;
}

.welcome-name {
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.welcome-details {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.welcome-subtitle {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

@media (max-width: 575px) {
  .welcome-banner {
    padding: 0.9rem 0.95rem;
  }

  .welcome-avatar {
    width: 3rem;
    height: 3rem;
    flex-basis: 3rem;
  }
}

.stats-shortcuts {
  display: grid;
  gap: 0.75rem;
}

.calendar-card {
  padding: 0.9rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.07);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.calendar-month-label {
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
}

.calendar-nav-button {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 1.25rem;
  line-height: 1;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}

.calendar-weekdays {
  margin-bottom: 0.45rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calendar-day {
  position: relative;
  min-height: 3.2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  padding: 0.45rem 0.35rem 0.35rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-weight: 600;
}

.calendar-day:hover {
  border-color: rgba(255, 149, 63, 0.45);
  background: rgba(255, 255, 255, 0.07);
}

.calendar-day.is-outside {
  opacity: 0.34;
}

.calendar-day.has-events {
  background: var(--calendar-event-accent, linear-gradient(135deg, var(--accent), var(--accent-strong)));
  color: #1a1410;
  border-color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.calendar-day.has-events:hover {
  border-color: rgba(10, 16, 24, 0.28);
  filter: brightness(1.02);
}

.calendar-day.is-selected {
  border-color: rgba(255, 149, 63, 0.95);
  background: rgba(255, 149, 63, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 149, 63, 0.14);
}

.calendar-day.has-events.is-selected {
  background: var(--calendar-event-accent, linear-gradient(135deg, var(--accent), var(--accent-strong)));
  border-color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.calendar-day.has-events.is-today {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.calendar-day.has-events.is-selected.is-today {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.calendar-day.has-events::after {
  content: attr(data-event-count);
  position: absolute;
  right: 0.3rem;
  bottom: 0.28rem;
  color: rgba(26, 20, 16, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stats-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.stats-nav-button {
  min-height: 40px;
}

.stats-nav-button.is-active,
.stats-nav-button.is-active:hover,
.stats-nav-button.is-active:focus {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #1a1410;
}

.match-round-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.match-round-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.match-round-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.round-chip {
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.round-chip.is-complete {
  border-color: rgba(24, 192, 122, 0.5);
  background: rgba(24, 192, 122, 0.14);
  color: #baf5d9;
}

.round-chip.is-all-complete,
.round-chip.is-all-complete:hover,
.round-chip.is-all-complete:focus {
  border-color: rgba(24, 192, 122, 0.68);
  background: rgba(24, 192, 122, 0.2);
  color: #d5ffea;
}

.round-chip.is-active,
.round-chip.is-active:hover,
.round-chip.is-active:focus {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #1a1410;
}

.round-chip.is-active.is-all-complete,
.round-chip.is-active.is-all-complete:hover,
.round-chip.is-active.is-all-complete:focus {
  background: linear-gradient(135deg, #18c07a, #5be39f);
  border-color: transparent;
  color: #0f1f16;
}

.event-list,
.list-stack {
  display: grid;
  gap: 0.8rem;
}

.create-divider {
  position: relative;
  text-align: center;
}

.create-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.create-divider span {
  position: relative;
  display: inline-block;
  padding: 0 0.75rem;
  background: rgba(17, 24, 39, 0.82);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.event-option,
.list-card,
.stack-card,
.summary-card,
.stat-tile {
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.event-option {
  padding: 0.95rem 1rem;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

.event-option:hover {
  border-color: rgba(255, 149, 63, 0.45);
  transform: translateY(-1px);
}

.event-option-body {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
  position: relative;
}

.event-option-body:focus-visible {
  border-radius: 0.9rem;
  outline: 2px solid rgba(255, 216, 188, 0.9);
  outline-offset: 4px;
}

.set-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 3rem;
  border-radius: 1rem;
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.set-badge .set-symbol,
.set-badge .set-symbol-fallback {
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 1.6rem;
}

.set-badge-code {
  line-height: 1;
}

.set-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.set-preview img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.set-preview.empty {
  color: rgba(245, 247, 251, 0.7);
  font-size: 1.6rem;
  font-weight: 700;
}

.pod-count-input {
  width: 80px;
  min-width: 80px;
  padding-inline: 0.55rem;
  text-align: center;
}

.date-event-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

.meta-pill,
.date-pill,
.info-chip,
.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font-size: 0.8rem;
}

.meta-pill,
.date-pill,
.info-chip {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.date-pill {
  white-space: nowrap;
}

.summary-card,
.stack-card,
.stat-tile {
  padding: 1rem;
}

.summary-card {
  padding: 0.8rem 0.9rem;
}

.stack-card {
  padding: 0.9rem;
}

.field-grid {
  display: grid;
  gap: 0.9rem;
}

.compact-grid {
  gap: 0.75rem;
}

.shared-info-grid {
  grid-template-columns: 70px minmax(0, 1fr);
}

.shared-info-grid > :last-child {
  grid-column: 1 / -1;
}

.match-round-field {
  max-width: 7rem;
}

.choice-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.choice-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.52rem 0.82rem;
  font-weight: 600;
}

.choice-chip.active {
  background: rgba(255, 149, 63, 0.16);
  border-color: rgba(255, 149, 63, 0.75);
}

#score-row .choice-chip {
  min-width: 4rem;
}

.match-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.list-card {
  padding: 0.95rem 1rem;
}

.activity-card {
  display: grid;
  gap: 0.1rem;
}

.activity-player-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.activity-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

button.activity-player-badge,
button.event-participant-chip {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.activity-player-avatar {
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 1.7rem;
}

.activity-player-badge.is-mock .activity-player-avatar .player-avatar-core {
  background: rgba(34, 16, 23, 0.92);
  border-color: rgba(255, 95, 122, 0.82);
  color: #ffd7de;
}

.activity-player-badge.is-npc .activity-player-avatar .player-avatar-core {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.activity-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-main);
  font-weight: 700;
}

.activity-player-badge.is-clickable:hover .activity-player-name,
.activity-player-badge.is-clickable:focus-visible .activity-player-name {
  color: #ffd8bc;
}

.activity-player-badge.is-clickable:focus-visible {
  border-radius: 999px;
  outline: 2px solid rgba(255, 216, 188, 0.9);
  outline-offset: 3px;
}

.activity-player-versus {
  position: relative;
  top: 1px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.list-title-row,
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.list-title-row {
  align-items: flex-start;
}

.list-title-row > :first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.summary-grid {
  display: grid;
  gap: 0.6rem;
}

.compact-banner {
  display: grid;
  gap: 0.55rem;
}

.event-participant-block {
  margin-top: 0.7rem;
}

.event-participant-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(210, 220, 236, 0.76);
  margin-bottom: 0.45rem;
}

.event-participant-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.event-participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  max-width: 100%;
  padding: 0.28rem 0.6rem 0.28rem 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.event-participant-chip.is-clickable:hover,
.event-participant-chip.is-clickable:focus-visible {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
}

.event-participant-chip.is-clickable:focus-visible {
  outline: 2px solid rgba(255, 216, 188, 0.9);
  outline-offset: 2px;
}

.event-participant-avatar {
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 1.55rem;
}

.event-participant-chip.is-mock {
  background: rgba(255, 95, 122, 0.08);
  border-color: rgba(255, 95, 122, 0.22);
}

.event-participant-chip.is-mock .event-participant-avatar .player-avatar-core {
  background: rgba(34, 16, 23, 0.92);
  border-color: rgba(255, 95, 122, 0.82);
  color: #ffd7de;
}

.event-participant-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: inherit;
}

.compact-banner-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.compact-banner-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-main);
}

.compact-banner-date {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

.compact-banner-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.compact-banner-meta {
  margin-top: 0;
}

.summary-row span:first-child {
  color: var(--text-muted);
  font-weight: 500;
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.mini-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.mini-button.danger {
  border-color: rgba(255, 95, 122, 0.35);
  color: #ffc1cb;
}

.result-pill.win {
  background: rgba(24, 192, 122, 0.16);
  color: #a4f3cd;
}

.result-pill.loss {
  background: rgba(255, 95, 122, 0.16);
  color: #ffc1cb;
}

.result-pill.draw {
  background: rgba(140, 180, 255, 0.16);
  color: #d2e1ff;
}

.stats-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-tile strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-tile span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.stats-section {
  margin-top: 1.4rem;
}

.empty-state {
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
}

.alert-warning {
  background: rgba(255, 214, 102, 0.12);
  border-color: rgba(255, 214, 102, 0.35);
  color: #ffe8b0;
  border-radius: 1rem;
}

@media (max-width: 479px) {
  .account-modal-header {
    flex-direction: column;
  }

  .account-modal {
    padding: 1rem;
  }

  .account-modal-header .account-modal-close {
    align-self: flex-end;
  }

  .account-modal-actions .btn {
    width: 100%;
  }
}

@media (min-width: 640px) {
  .app-shell {
    --app-shell-top-padding: 2rem;
    --app-shell-side-padding: 1rem;
  }

  .stats-shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shared-info-grid {
    grid-template-columns: 70px minmax(0, 1.2fr) minmax(0, 0.9fr);
  }

  .shared-info-grid > :last-child {
    grid-column: auto;
  }
}
