/* Shared Aero palette and geometry. Common panel, border and text tokens
   keep cards and dialogs consistent. */
:root {
  color-scheme: light;
  --bg: #032436;
  --panel: #edf6fb;
  --panel2: #e0eff8;
  --line: #a8c4d6;
  --text: #173d54;
  --muted: #496b80;
  --lime: #177cb6;
  --orange: #a9662d;
  --radius: 7px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI",Tahoma,Arial,sans-serif;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button, input, select {
  touch-action: manipulation;
}

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid #197caf;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

/* The SVG symbol library stays out of layout. Icon instances inherit text color
   and leave pointer interaction to their surrounding controls. */
.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.ui-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  pointer-events: none;
}

/* The background stage shows a static gradient before the canvas starts or when
   drawing fails. It stays behind the authentication and collection views. */
#xmbBackground {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  contain: paint;
  pointer-events: none;
  background: linear-gradient(155deg,#031c52,#0759a4 48%,#062352);
}

/* The collection shell sets a common width so its header, filters, summary
   tiles and cards line up. */
.app {
  width: calc(100% - 48px);
  max-width: 1320px;
  margin: 28px auto 36px;
  padding: 0 22px 18px;
  position: relative;
  border: 1px solid #f5fcff;
  border-radius: 11px;
  background: linear-gradient(135deg,#e9f4fb,#d7eaf5);
  box-shadow: 0 16px 40px #00142655,0 0 0 5px #c1e8ff21,inset 0 1px #fff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 0;
  border-bottom: 1px solid #a6c4d6;
  box-shadow: 0 1px #ffffffb3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.45px;
}

.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 3px #23617b40);
}

.brand em {
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  color: #56778c;
  letter-spacing: 0;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Position the disclosure relative to its toggle. The script keeps the hidden
   state and aria-expanded in sync and handles focus on close. */
.app-menu-container {
  position: relative;
  flex: 0 0 auto;
}

.app-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 33px;
  padding: 6px 10px;
  border: 1px solid #729fba;
  border-radius: 4px;
  background: linear-gradient(#fff,#e5f5fc 45%,#c6e0ef 49%,#edf8fd);
  box-shadow: inset 0 1px #fff,0 1px 2px #34556c25;
  color: #2c607e;
  font-size: 12px;
  white-space: nowrap;
  text-shadow: 0 1px #fff;
}

.app-menu-toggle .ui-icon {
  width: 15px;
  height: 15px;
}

.app-menu-toggle .menu-chevron {
  width: 12px;
  height: 12px;
}

.app-menu-toggle[aria-expanded="true"] {
  border-color: #3883ad;
  background: linear-gradient(#d3eaf7,#e2f3fb);
  box-shadow: inset 0 1px 3px #426d8830,0 0 5px #6fc7ec35;
}

.app-menu-toggle:hover {
  border-color: #2b86b4;
}

.app-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 258px;
  max-width: calc(100vw - 48px);
  z-index: 15;
  border: 1px solid #7fabc7;
  border-radius: 6px;
  background: #f3f9fd;
  box-shadow: 0 8px 22px #143c5c38,0 0 0 3px #e7f7ff70;
  overflow: hidden;
  color: #254c66;
}

.app-menu-title {
  padding: 8px 12px;
  border-bottom: 1px solid #aac9dc;
  box-shadow: inset 0 1px #fff;
  background: linear-gradient(#eaf7ff,#d4ebf9 46%,#bfdced 49%,#e1f1fb);
  font-size: 11px;
  color: #436f8b;
  text-shadow: 0 1px #fff;
}

.app-menu-items {
  padding: 5px;
}

.app-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 59px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #2b5c7a;
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
}

.app-menu-item:hover, .app-menu-item:focus-visible {
  border-color: #8abbd7;
  background: linear-gradient(#f3fbff,#d8edf9);
  box-shadow: inset 0 1px #fff;
}

.app-menu-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 29px;
  height: 30px;
  border-right: 1px solid #c3d9e6;
  padding-right: 10px;
  color: #5a92b3;
}

.app-menu-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.app-menu-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.app-menu-copy>span {
  font-weight: 500;
}

.app-menu-copy small {
  font-size: 11px;
  color: #648297;
}

.app-menu-separator {
  height: 1px;
  margin: 5px 10px;
  background: #c1d7e5;
  box-shadow: 0 1px #fff;
}

.app-menu-logout {
  color: #795745;
}

.app-menu-logout .app-menu-icon {
  color: #9a7d65;
}

.app-menu-logout small {
  color: #856f62;
}

/* Shared styling for the color control in the Theme menu and the header
   badge that reports the current connection or storage state. */
.theme-picker, .local-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  border: 1px solid #b1c9d8;
  border-radius: 4px;
  min-height: 29px;
  padding: 5px 8px;
  background: linear-gradient(#fbfeff,#dbeaf4);
  box-shadow: inset 0 1px #fff;
  color: #496b80;
}

.theme-picker {
  cursor: pointer;
}

.theme-picker input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid #fff;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.theme-picker input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.theme-picker input::-webkit-color-swatch {
  border: 1px solid #4b7993;
  border-radius: 50%;
}

.theme-picker input::-moz-color-swatch {
  border: 1px solid #4b7993;
  border-radius: 50%;
}

.dot {
  height: 6px;
  width: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4da277;
  box-shadow: 0 0 4px #70bf7666;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding: 35px 0 26px;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 11px;
  letter-spacing: 1.6px;
  color: #476f87;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: -1.3px;
  font-weight: 400;
  text-shadow: 0 1px #fff;
}

.hero h1 .hero-heading-accent {
  color: #5085a4;
}

.hero p:not(.eyebrow) {
  font-size: 12px;
  margin: 10px 0 0;
  color: var(--muted);
}

.primary, .secondary, .danger {
  border: 1px solid #6c9fba;
  border-radius: 4px;
  min-height: 34px;
  padding: 7px 12px;
  background: linear-gradient(#fff 0%,#e3f3fb 46%,#c4deec 49%,#eff9fd 100%);
  box-shadow: inset 0 1px #fff,0 1px 2px #34556c25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 12px;
  text-shadow: 0 1px #fff;
}

.primary {
  border-color: #3985ad;
  background: linear-gradient(#f7feff,#d1eefb 44%,#89c7e5 48%,#cfeefe);
  box-shadow: inset 0 1px #fff,0 1px 3px #28608338;
  font-weight: 500;
}

.primary:hover:not(:disabled), .secondary:hover:not(:disabled) {
  border-color: #2683b6;
  background: linear-gradient(#fff,#e0f7ff 44%,#9bd9f3 48%,#e1f7ff);
  box-shadow: 0 0 7px #48bbec42,inset 0 1px #fff;
}

.danger {
  border-color: #b36562;
  background: linear-gradient(#fff8f5,#f7d8d3 47%,#e8aaa3 50%,#f8e0db);
  color: #742b29;
}

.danger:hover {
  border-color: #943e37;
  background: linear-gradient(#fff9f7,#fbd9d1 47%,#e59b90 50%,#f7d2c8);
}

.primary:disabled, .secondary:disabled, .danger:disabled {
  opacity: .72;
}

/* These totals describe the entire collection. The live result count below
   reports how many entries match the current filters. */
.stats {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.stat {
  position: relative;
  padding: 14px 16px;
  border: 1px solid #aec8d9;
  border-radius: var(--radius);
  background: linear-gradient(145deg,#fcfeff,#e0eff7);
  box-shadow: inset 0 1px #fff,0 2px 4px #50718a12;
  overflow: hidden;
  min-width: 0;
}

.stat:after {
  content: "";
  position: absolute;
  pointer-events: none;
  right: -10px;
  top: -30px;
  transform: rotate(-20deg);
  width: 90px;
  height: 120px;
  background: linear-gradient(90deg,transparent,#fff8,transparent);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-size: 11px;
  color: #52758c;
}

.stat-label .ui-icon {
  width: 13px;
  height: 13px;
  color: #548eb1;
}

.stat-value {
  font-size: 27px;
  line-height: 1.2;
  font-weight: 400;
  margin-top: 6px;
  color: #204d69;
}

.stat-value small {
  font-size: 11px;
  color: #638096;
  margin-left: 4px;
  font-weight: 400;
}

/* Give search more room than individual filters on desktop. Shared input
   styles keep the toolbar, editor and sign-in controls consistent. */
.toolbar {
  display: grid;
  grid-template-columns: minmax(150px,1.7fr) repeat(4,minmax(0,1fr)) minmax(90px,.7fr);
  align-items: end;
  gap: 8px;
  padding: 12px;
  border: 1px solid #aac7d9;
  border-radius: var(--radius);
  background: linear-gradient(#eaf6fd,#cfe3f0);
  box-shadow: inset 0 1px #fff;
  margin: 0 0 9px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.filter-label {
  font-size: 11px;
  color: #446c84;
}

.search {
  position: relative;
  display: block;
  min-width: 0;
}

.search .ui-icon {
  position: absolute;
  left: 9px;
  top: 10px;
  width: 14px;
  height: 14px;
  color: #5588a6;
}

.toolbar input, .toolbar select, .field input, .field select, .auth-field input {
  border: 1px solid #94b2c7;
  border-top-color: #7199b3;
  border-radius: 4px;
  background: linear-gradient(#f1f7fa,#fff 12px);
  box-shadow: inset 0 1px 3px #35597115;
  padding: 8px 9px;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  font-size: 12px;
}

.toolbar .search input {
  padding-left: 30px;
}

.toolbar select {
  padding-right: 3px;
}

.toolbar select option, .field select option {
  background: #f6fbff;
  color: var(--text);
}

.toolbar input:focus,
.toolbar select:focus,
.field input:focus,
.field select:focus,
.auth-field input:focus {
  border-color: #398fc0;
  box-shadow: 0 0 5px #56afe04d,inset 0 1px 3px #3a5c7018;
}

.count {
  font-size: 11px;
  color: #54778e;
  text-align: right;
  margin: 4px 1px 10px;
  min-height: 16px;
  text-transform: lowercase;
}

/* Keep covers fully visible, with a text fallback in the same media area.
   Flexible card bodies push the status and action buttons to the bottom. */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 11px;
}

.game-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #9cb9cd;
  background: linear-gradient(145deg,#f9fdff,#e0eff8);
  border-radius: var(--radius);
  box-shadow: 0 3px 6px #2b5d7b20,inset 0 1px #fff;
  min-width: 0;
  overflow: hidden;
  transition: border-color .16s,box-shadow .16s;
}

.game-card:hover, .game-card:focus-within {
  border-color: #238bbf;
  box-shadow: 0 0 0 1px #effcff,0 0 11px #31b8ed55,0 4px 8px #2b5d7b20;
}

.cover {
  position: relative;
  flex: 0 0 auto;
  height: 185px;
  padding: 8px;
  background: linear-gradient(140deg,#e6f1f8,#f9fcff);
  border-bottom: 1px solid #bdd3e1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cover-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px #183f5745);
}

.cover:after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  box-shadow: inset 0 1px #ffffffa6;
}

.cover-title {
  position: relative;
  color: #315773;
  font-size: 23px;
  font-weight: 500;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: -.5px;
  line-height: 1.1;
  overflow-wrap: anywhere;
  max-width: 90%;
  text-shadow: 0 1px #fff;
}

.card-body {
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 112px;
  min-width: 0;
}

.game-title {
  display: flex;
  align-items: center;
  min-height: 43px;
  min-width: 0;
  padding: 10px;
  border-bottom: 1px solid #a8c4d6;
  background: linear-gradient(#f4fcff,#e0f1fb 46%,#cbe3f1 49%,#e7f4fc);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 500;
  color: #1d435b;
  overflow-wrap: anywhere;
  text-shadow: 0 1px #fff;
  margin: 0;
}

.edition-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #50758f;
  min-height: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.edition-meta .ui-icon {
  width: 12px;
  height: 12px;
}

.edition-meta .edition-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
  min-height: 0;
}

.platform-chip {
  font-size: 11px;
  line-height: 1.4;
  color: #587b92;
  background: #e7f1f8;
  border: 1px solid #c5dce9;
  border-radius: 3px;
  padding: 2px 5px;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.card-bottom {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #526d80;
  background: #e6eef4;
  border: 1px solid #c1d4df;
  border-radius: 3px;
  padding: 3px 5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.status .ui-icon {
  width: 12px;
  height: 12px;
}

.status.ograna {
  color: #316e4e;
  background: #e2f1e8;
  border-color: #c0ddca;
}

.status.w-trakcie {
  color: #8d5a27;
  background: #fff0db;
  border-color: #e4d0ac;
}

.card-menu {
  display: flex;
  gap: 4px;
  margin-left: auto;
  position: relative;
  z-index: 1;
  opacity: 1;
}

.icon-btn {
  width: 28px;
  min-height: 28px;
  border: 1px solid #a1bdcf;
  border-radius: 4px;
  background: linear-gradient(#fff,#d8eaf5);
  display: grid;
  place-items: center;
  padding: 4px;
  box-shadow: inset 0 1px #fff;
}

.icon-btn .ui-icon {
  width: 14px;
  height: 14px;
  color: #3a6c89;
}

.icon-btn:hover, .card-menu:focus-within .icon-btn:focus-visible {
  border-color: #2c86b5;
  background: #e8f7ff;
}

.empty {
  grid-column: 1/-1;
  border: 1px dashed #a2bfd2;
  border-radius: var(--radius);
  padding: 45px 22px;
  background: linear-gradient(#f6fbff,#e2f0f8);
  text-align: center;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.empty-icon {
  color: #6a9cba;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon .ui-icon {
  width: 30px;
  height: 30px;
}

.empty h2 {
  font-size: 18px;
  font-weight: 400;
  margin: 0;
}

.empty p {
  font-size: 12px;
  color: var(--muted);
  max-width: 360px;
  margin: 0;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #aac4d5;
  box-shadow: 0 -1px #fff8;
  margin-top: 26px;
  padding-top: 13px;
  color: #54778d;
}

.footer-title {
  font-size: 11px;
  letter-spacing: .5px;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.text-btn, .cover-search {
  background: none;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #356f91;
  text-decoration: none;
  min-height: 26px;
}

.text-btn .ui-icon, .cover-search .ui-icon {
  height: 13px;
  width: 13px;
}

.text-btn:hover, .cover-search:hover {
  text-decoration: underline;
  color: #154a6b;
}

/* Dialogs share a fixed backdrop and the same open-state class. The editor
   scrolls its form body so its header and action row stay reachable. */
.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: #173b5c70;
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(100%,580px);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(135deg,#f5fbff,#dfedf6);
  border: 1px solid #f5fdff;
  border-radius: 9px;
  box-shadow: 0 18px 45px #001d3b77,0 0 0 5px #a7cee655;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  padding: 13px 17px;
  border-bottom: 1px solid #9cb9cd;
  background: linear-gradient(#d8effc,#eaf7ff 46%,#bbd9ed 49%,#d9edfa);
  box-shadow: inset 0 1px #fff;
}

.modal-heading {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-width: 0;
}

.modal-heading>.ui-icon {
  width: 20px;
  height: 20px;
  color: #368ab9;
  margin-top: 2px;
}

.modal h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 400;
  text-shadow: 0 1px #fff;
  margin: 0;
}

.modal-sub {
  font-size: 12px;
  color: #58788d;
  margin: 4px 0 0;
}

.close {
  align-self: flex-start;
  flex: 0 0 auto;
  border: 1px solid #a86c66;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(#f6e2dc,#ca7c71 50%,#b46357);
  color: #fff;
  text-shadow: 0 1px #754139;
  padding: 2px 11px;
  min-height: 26px;
  box-shadow: inset 0 1px #fffb;
  display: grid;
  place-items: center;
}

.close .ui-icon {
  width: 14px;
  height: 14px;
}

.close:hover {
  background: linear-gradient(#fbe8e1,#d48b7d 50%,#bc5949);
}

#gameForm {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.full {
  grid-column: 1/-1;
}

.field>label, .platform-picker>legend {
  font-size: 12px;
  color: #3b6480;
  font-weight: 500;
}

.field-help, .platform-help {
  font-size: 11px;
  color: #5a7a8d;
  line-height: 1.45;
}

/* Manufacturer fieldsets and native checkboxes supply the initial layout.
   Keep label hit areas and checkbox styles intact when tabs are added. */
.platform-picker {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.platform-picker>legend {
  padding: 0;
  margin-bottom: 8px;
}

.platform-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.platform-group {
  min-width: 0;
  border: 1px solid #bacfdd;
  border-radius: 4px;
  padding: 7px 9px 9px;
  margin: 0;
  background: #edf5fb;
}

.platform-group>legend {
  padding: 0 5px;
  color: #4e7893;
  font-size: 11px;
  font-weight: 500;
}

.platform-choice-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 5px;
}

.platform-option {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  line-height: 1.35;
  padding: 6px 5px;
  min-height: 30px;
  border-radius: 3px;
  min-width: 0;
  cursor: pointer;
}

.platform-option:has(input:checked) {
  background: linear-gradient(#f7fcff,#d1e9f9);
  box-shadow: inset 0 0 0 1px #8fb8d3;
}

.platform-option input {
  appearance: auto;
  accent-color: #227eae;
  flex: 0 0 auto;
  margin: 0;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border: initial;
  border-radius: initial;
  background: initial;
  box-shadow: none;
}

.platform-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.platform-help {
  display: block;
  margin-top: 8px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  flex: 0 0 auto;
  padding: 13px 18px;
  background: linear-gradient(#ecf5fb,#d6e7f2);
  border-top: 1px solid #b3cbdc;
}

/* Aero game editor with a cover preview. */
/* The preview reserves a stable media slot so a loaded image and its
   placeholder can share the layout without shifting the form fields. */
.modal.game-modal {
  width: min(100%,680px);
}

.game-modal h2 {
  font-size: 19px;
  letter-spacing: -.35px;
}

.game-modal #gameForm {
  flex: 1;
}

.game-modal .form-grid {
  display: block;
  background: linear-gradient(130deg,#f8fcff,#e8f3fb);
}

.game-details {
  display: grid;
  grid-template-columns: 132px minmax(0,1fr);
  gap: 20px;
  align-items: start;
}

.game-fields {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  min-width: 0;
}

.game-modal .field input:not([type="checkbox"]), .game-modal .field select {
  min-height: 37px;
  font-size: 13px;
}

.game-modal .field input::placeholder {
  color: #7890a1;
  opacity: 1;
}

.field-optional {
  font-size: 11px;
  font-weight: 400;
  color: #698397;
  margin-left: 4px;
}

.cover-preview-frame {
  padding: 8px;
  border: 1px solid #b5cddb;
  border-radius: 7px;
  background: linear-gradient(145deg,#d2e3ee,#f6fbff 65%,#d6e7f3);
  box-shadow: inset 0 1px #fff;
  min-width: 0;
  text-align: center;
}

.cover-preview-media {
  height: 158px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

#coverPreview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px #274a6130);
}

.cover-preview-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7295ad;
}

.cover-preview-placeholder .ui-icon {
  width: 38px;
  height: 38px;
  stroke-width: 1.3;
}

.cover-preview-title {
  font-size: 12px;
  font-weight: 500;
  color: #365e79;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.cover-preview-status {
  font-size: 11px;
  color: #5b7d94;
  margin: 7px 0 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.game-modal .cover-search {
  font-size: 11px;
  line-height: 1.4;
  min-height: 20px;
  align-self: flex-start;
}

.cover-search-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.ai-cover-search-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.game-modal .ai-cover-search-button {
  max-width: 100%;
  white-space: normal;
}

/* The enhanced picker displays one manufacturer at a time. Counts and chips
   reflect selections across groups, including ones that are currently hidden. */
.game-modal .platform-picker {
  margin-top: 23px;
}

.game-modal .platform-picker>legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  font-size: 13px;
  color: #365f7b;
}

.platform-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.platform-picker-label .ui-icon {
  width: 15px;
  height: 15px;
  color: #5e90ae;
}

.platform-selection-count {
  font-size: 11px;
  font-weight: 400;
  color: #617f93;
  white-space: nowrap;
}

.platform-console-box {
  border: 1px solid #aac7d9;
  border-radius: 7px;
  background: #f6fbff;
  box-shadow: inset 0 1px #fff;
  overflow: hidden;
}

.platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 7px 8px 0;
  border-bottom: 1px solid #b6cede;
  background: #e6f0f8;
}

.platform-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 31px;
  margin-bottom: -1px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 5px 5px 0 0;
  background: transparent;
  color: #52758e;
  font-size: 12px;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.platform-tab[aria-selected="true"] {
  position: relative;
  border-color: #aac5d8;
  border-bottom-color: #f6fbff;
  background: linear-gradient(#fff,#f6fbff);
  color: #1f5477;
}

.platform-tab-count {
  font-size: 11px;
  opacity: .75;
}

.game-modal .platform-options {
  padding: 12px;
}

.game-modal .platform-options.platform-tabs-ready {
  display: block;
}

.game-modal .platform-tabs-ready>.platform-group {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.game-modal .platform-tabs-ready>.platform-group>legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.game-modal .platform-option {
  min-height: 33px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.35;
  user-select: none;
}

.game-modal .platform-option:has(input:checked) {
  border-color: #a5c9df;
  background: linear-gradient(#eff9ff,#d8ebf8);
  box-shadow: inset 0 1px #fff;
}

.game-modal .platform-option:hover {
  background: #e6f2fb;
}

.game-modal .platform-option input {
  width: 15px;
  height: 15px;
}

.game-modal .platform-help {
  margin: 0;
  padding: 10px 12px;
  background: #eef5fa;
  border-top: 1px solid #d0e0eb;
  font-size: 11px;
  color: #6c889b;
  line-height: 1.5;
}

.selected-platforms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding-top: 10px;
}

.selected-platforms-label {
  font-size: 11px;
  color: #658398;
  margin-right: 2px;
}

.selected-platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid #b5cddd;
  border-radius: 4px;
  background: #edf5fb;
  color: #466d86;
  font-size: 11px;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.selected-platform-chip .ui-icon {
  width: 11px;
  height: 11px;
  color: #2a88a8;
}

.selected-platforms-empty {
  font-size: 11px;
  color: #70899b;
  padding: 4px 0;
}

.game-modal .form-actions {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.form-required-note {
  margin-right: auto;
  font-size: 11px;
  color: #688297;
  line-height: 1.4;
}

.game-modal .form-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  margin-left: auto;
}

/* Narrow layouts reduce the preview first, then move it above the fields
   at the smallest width. The platform choices reduce to two columns. */
@media (max-width: 700px) {
  .game-modal .form-grid {
    padding: 15px;
  }

  .game-modal .game-details {
    gap: 16px;
  }

  .game-modal .platform-choice-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media (max-width: 560px) {
  .game-modal .game-details {
    grid-template-columns: 88px minmax(0,1fr);
    gap: 12px;
  }

  .game-modal .game-fields {
    grid-template-columns: minmax(0,1fr);
    gap: 12px;
  }

  .game-modal .field.full {
    grid-column: auto;
  }

  .game-modal .cover-preview-frame {
    padding: 6px;
  }

  .game-modal .cover-preview-media {
    height: 115px;
  }

  .game-modal .cover-preview-title {
    font-size: 11px;
  }

  .game-modal .platform-picker {
    margin-top: 21px;
  }

  .game-modal .platform-choice-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .game-modal .platform-tabs {
    padding-left: 6px;
    padding-right: 6px;
  }

  .game-modal .platform-tab {
    padding: 8px 7px;
    font-size: 11px;
  }

  .game-modal .platform-help {
    padding: 10px;
  }

  .game-modal .form-actions {
    padding: 12px 14px;
  }
}

@media (max-width: 380px) {
  .game-modal .game-details {
    grid-template-columns: minmax(0,1fr);
  }

  .game-modal .cover-preview-frame {
    display: grid;
    grid-template-columns: 60px minmax(0,1fr);
    align-items: center;
    gap: 10px;
    text-align: left;
  }

  .game-modal .cover-preview-media {
    height: 80px;
  }

  .game-modal .cover-preview-title {
    margin-top: 0;
  }

  .game-modal .platform-picker>legend {
    font-size: 12px;
  }

  .game-modal .form-required-note {
    width: 100%;
    margin: 0 0 1px;
  }
}

@media (pointer: coarse) {
  .game-modal .cover-search, .game-modal .ai-cover-search-button {
    min-height: 44px;
  }

  .game-modal .platform-option, .game-modal .platform-tab {
    min-height: 44px;
  }

  .game-modal .field input:not([type="checkbox"]), .game-modal .field select {
    min-height: 44px;
    font-size: 16px;
  }
}

/* Authentication has its own full-screen layer and scrollable card. The
   brand panel and credential form sit side by side until space is limited. */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #09253d33;
}

.auth-card {
  width: min(100%,780px);
  max-height: calc(100dvh - 36px);
  display: grid;
  grid-template-columns: minmax(220px,.83fr) minmax(0,1.17fr);
  overflow-y: auto;
  border: 1px solid #f3fcff;
  border-radius: 9px;
  background: #edf6fc;
  box-shadow: 0 18px 40px #00172466,0 0 0 5px #c0e7ff21,inset 0 1px #fff;
}

.auth-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 35px 30px;
  border-right: 1px solid #b1cfe1;
  background: linear-gradient(145deg,#075585,#0d638c 65%,#064b76);
  color: #f1fbff;
}

.auth-brand:after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(115deg,#ffffff14,transparent 42%,#e1f7ff0a 42.3%,transparent 79%);
  pointer-events: none;
}

.auth-brand-logo {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  margin: 0 0 13px;
  filter: drop-shadow(0 3px 5px #002b4770);
}

.auth-brand-title {
  font-size: 25px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -.8px;
  color: #f4fcff;
  text-shadow: 0 1px #024b72;
}

.auth-brand-eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  line-height: 1.5;
  color: #e5f3fc;
  margin: 34px 0 9px;
}

.auth-brand h2 {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.13;
  letter-spacing: -.8px;
  max-width: 220px;
  margin: 0;
  color: #f5fcff;
  text-shadow: 0 1px #07527d;
}

.auth-brand-description {
  font-size: 12px;
  line-height: 1.7;
  color: #e5f3fc;
  max-width: 235px;
  margin: 14px 0 0;
}

.auth-brand-wave {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: 190%;
  height: 50%;
  left: -25%;
  bottom: -4%;
  border-top: 1px solid #c2ecff55;
  border-radius: 50%;
  transform: rotate(-21deg);
  background: #53b5d319;
}

.auth-brand-wave:nth-child(2) {
  bottom: 8%;
  left: -80%;
  transform: rotate(22deg);
  background: #75cbdf12;
  border-top-color: #d2f6ff24;
}

.auth-body {
  min-width: 0;
  padding: 33px 31px 30px;
  background: linear-gradient(125deg,#fbfeff,#e4f1fa);
}

.auth-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.auth-language {
  flex: 0 0 auto;
  margin-bottom: 9px;
}

.auth-language select {
  border: 1px solid #94b2c7;
  border-radius: 4px;
  background: #f6fbff;
  min-height: 34px;
  padding: 4px 6px;
  font-size: 12px;
}

.auth-card h1 {
  font-size: 25px;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -.6px;
  margin: 0 0 9px;
  color: #21475f;
  text-shadow: 0 1px #fff;
  overflow-wrap: anywhere;
}

.auth-intro, .auth-help {
  font-size: 13px;
  color: #4f7088;
  line-height: 1.6;
  margin: 0 0 23px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 15px 0;
  min-width: 0;
}

.auth-field label {
  font-size: 12px;
  color: #456c86;
  font-weight: 500;
}

.auth-field input {
  min-height: 43px;
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.4;
}

.auth-field input::placeholder {
  color: #597286;
  opacity: 1;
}

.auth-field input:focus {
  border-color: #2b8cbe;
  box-shadow: 0 0 6px #37a8d947,inset 0 1px 2px #36607912;
}

.auth-password {
  position: relative;
  min-width: 0;
}

.auth-password input {
  padding-right: 46px;
}

.auth-password-toggle {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 36px;
  height: 37px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #668ba3;
  font-size: 11px;
}

.auth-password-toggle:hover {
  background: #e6f3fb;
  color: #266f98;
}

.auth-password-toggle .ui-icon {
  width: 16px;
  height: 16px;
}

.auth-card .primary {
  width: 100%;
  min-height: 43px;
  margin-top: 20px;
  padding: 10px 16px;
  border-color: #478aaf;
  background: linear-gradient(#f9feff,#d3eefb 43%,#91cce8 48%,#d3effb);
  box-shadow: inset 0 1px #fff,0 2px 4px #35678324;
  color: #1d5272;
  font-size: 13px;
  line-height: 1.35;
}

/* The widget container takes space once a challenge is rendered. Empty
   messages collapse so transient connection or validation states leave no gaps. */
.captcha-widget {
  display: flex;
  justify-content: center;
  margin: 23px 0 0;
  max-width: 100%;
  overflow: visible;
}

.captcha-widget:empty {
  display: none;
}

.captcha-status {
  font-size: 11px;
  color: #3f7055;
  text-align: center;
  margin: 10px 0 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.auth-message {
  margin: 13px 0 0;
  color: #993e33;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.auth-message:empty, .captcha-status:empty {
  display: none;
}

#retryConnection {
  max-width: 100%;
  min-height: 38px;
  margin-top: 14px;
  white-space: normal;
}

/* Keep the honeypot outside the visible layout. Its markup also keeps it
   out of keyboard navigation and the accessibility tree. */
.captcha-trap {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.captcha-trap input {
  position: absolute;
  left: -10000px;
}

/* The narrow sign-in card uses a compact brand header and gives the form
   more width for credentials and the embedded verification widget. */
@media (max-width: 700px) {
  .auth-card {
    width: min(100%,440px);
    grid-template-columns: minmax(0,1fr);
  }

  .auth-brand {
    display: grid;
    grid-template-columns: 44px minmax(0,1fr);
    align-items: center;
    column-gap: 12px;
    padding: 22px 26px;
    border-right: 0;
    border-bottom: 1px solid #b1cfe1;
  }

  .auth-brand-logo {
    width: 44px;
    height: 44px;
    grid-row: 1/3;
    margin: 0;
  }

  .auth-brand-title {
    font-size: 22px;
  }

  .auth-brand-eyebrow {
    margin: 2px 0 0;
    font-size: 11px;
    letter-spacing: .7px;
  }

  .auth-brand h2, .auth-brand-description {
    display: none;
  }

  .auth-body {
    padding: 24px 26px;
  }
}

@media (max-width: 430px) {
  .top-right .theme-picker span {
    display: none;
  }

  .auth-screen {
    padding: 13px;
  }

  .auth-card {
    max-height: calc(100dvh - 26px);
  }

  .auth-body {
    padding: 22px 16px;
  }

  .auth-brand {
    padding: 20px 16px;
  }
}

@media (max-width: 375px) {
  .auth-screen {
    padding: 4px;
  }

  .auth-card {
    max-height: calc(100dvh - 8px);
  }

  .auth-body {
    padding: 22px 4px;
  }

  .auth-brand {
    padding: 20px 13px;
  }
}

@media (max-width: 340px) {
  .auth-screen {
    padding: 0;
  }

  .auth-card {
    max-height: 100dvh;
  }

  .auth-body {
    padding: 20px 1px;
  }

  .auth-brand {
    padding: 20px 10px;
  }
}

@media (pointer: coarse) {
  .app-menu-toggle {
    min-height: 44px;
  }

  .auth-field input {
    min-height: 46px;
  }

  .auth-card .primary {
    min-height: 46px;
    font-size: 14px;
  }

  .auth-password-toggle {
    top: 2px;
    right: 2px;
    width: 42px;
    height: 42px;
  }
}

/* The separate destructive confirmation uses a compact layout that still
   wraps long game titles and platform lists. */
.delete-modal {
  width: min(100%,460px);
}

.delete-body {
  padding: 22px 18px;
  display: flex;
  gap: 14px;
  overflow-y: auto;
}

.delete-body>div {
  min-width: 0;
}

.delete-body>.ui-icon {
  width: 32px;
  height: 32px;
  color: #b58237;
  flex-shrink: 0;
}

.delete-body p {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.delete-body strong {
  font-weight: 500;
}

.delete-platforms {
  display: block;
  font-size: 11px;
  color: #57778b;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.delete-note {
  font-size: 11px;
  color: #6b7d88;
  margin-top: 12px !important;
}

/* Status announcements occupy separate screen edges. The session warning
   stays above dialogs while the non-interactive toast reports actions. */
.toast {
  position: fixed;
  z-index: 40;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%,20px);
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(#f5fdff,#c6e6f5);
  border: 1px solid #4d99bd;
  color: #173b52;
  box-shadow: 0 3px 12px #21465c55;
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  max-width: calc(100% - 32px);
  overflow-wrap: anywhere;
  transition: opacity .2s,transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%,0);
}

.session-warning {
  position: fixed;
  z-index: 45;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: max-content;
  max-width: min(560px,calc(100% - 28px));
  padding: 11px 14px;
  border: 1px solid #c3a464;
  border-radius: 6px;
  background: linear-gradient(#fffdf3,#f6e7bc);
  box-shadow: inset 0 1px #fff,0 4px 14px #31455038;
  color: #665023;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}

.session-warning .ui-icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

/* Collection breakpoints reduce the grid from four columns to two, then one.
   Move search above the selects as the filter controls run out of room. */
@media (max-width: 900px) {
  .game-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 940px) {
  .app {
    width: calc(100% - 36px);
    padding-left: 16px;
    padding-right: 16px;
  }

  .toolbar {
    grid-template-columns: repeat(4,minmax(0,1fr)) minmax(90px,.7fr);
  }

  .filter-search {
    grid-column: 1/-1;
  }

  .local-badge {
    display: none;
  }
}

@media (max-width: 700px) {
  .app {
    width: calc(100% - 24px);
    margin: 16px auto 24px;
    padding: 0 13px 15px;
  }

  .topbar {
    gap: 10px;
    min-height: 63px;
    padding: 10px 0;
  }

  .brand {
    font-size: 15px;
    gap: 7px;
  }

  .brand em {
    display: none;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .theme-picker {
    font-size: 11px;
    gap: 5px;
    padding: 4px 6px;
  }

  .hero {
    display: block;
    padding: 25px 0 20px;
  }

  .hero h1 {
    font-size: 29px;
    letter-spacing: -.8px;
  }

  .hero>.hero-actions {
    margin-top: 15px;
  }

  .stats {
    gap: 7px;
  }

  .stat {
    padding: 12px 9px;
  }

  .stat-label {
    font-size: 11px;
    letter-spacing: .2px;
    gap: 4px;
  }

  .stat-label .ui-icon {
    display: none;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-value small {
    font-size: 11px;
    margin-left: 2px;
  }

  .toolbar {
    grid-template-columns: repeat(2,minmax(0,1fr));
    padding: 10px;
    gap: 9px;
  }

  .filter-search {
    grid-column: 1/-1;
  }

  .filter-language {
    grid-column: 2;
    justify-self: end;
    width: min(100%, 120px);
  }

  .cover-title {
    font-size: 18px;
  }

  .footer {
    display: block;
    margin-top: 20px;
  }

  .footer-actions {
    margin-top: 12px;
    gap: 16px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal {
    max-height: calc(100dvh - 24px);
  }

  .modal-head {
    padding: 12px;
  }

  .modal-sub {
    font-size: 11px;
  }

  .form-grid {
    gap: 12px;
    padding: 14px;
  }

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

  .platform-option {
    font-size: 12px;
    padding: 7px 4px;
  }
}

@media (max-width: 430px) {
  .game-grid {
    grid-template-columns: minmax(0,1fr);
  }

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

  .field.full {
    grid-column: auto;
  }

  .stat {
    padding: 10px 7px;
  }

  .stat-label {
    font-size: 10px;
    letter-spacing: 0;
  }

  .stat-value small {
    font-size: 10px;
  }

  .form-actions {
    padding: 12px 14px;
  }
}

@media (max-width: 360px) {
  .app {
    width: calc(100% - 16px);
    padding-left: 10px;
    padding-right: 10px;
  }

  .theme-picker span {
    display: none;
  }

  .stat-value small {
    display: none;
  }

  .stat-label {
    font-size: 10px;
  }
}

/* Larger controls help touch users. Keep the checkbox itself small because
   its surrounding label supplies the larger hit area. */
@media (pointer: coarse) {
  .primary, .secondary, .danger, .text-btn, .icon-btn, .platform-option, .close {
    min-height: 44px;
  }

  .icon-btn {
    width: 34px;
  }

  .toolbar input,
  .toolbar select,
  .field input:not([type="checkbox"]),
  .field select,
  .auth-field input,
  .auth-language select {
    min-height: 44px;
    font-size: 16px;
  }

  .platform-option input {
    min-height: 0;
  }
}

/* Match the background controllers' reduced-motion handling by removing the
   remaining CSS transitions from cards and status messages. */
@media (prefers-reduced-motion: reduce) {
  .game-card, .toast {
    transition: none;
  }

  #xmbBackground {
    opacity: .9;
  }
}
/* Appearance controls use the same native fields as the existing language
   chooser. Their labels are translated by the existing data-en bindings. */
.appearance-tools, .auth-appearance-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  min-width: 0;
}
.auth-appearance-controls { margin-bottom: 13px; }
.appearance-picker, .background-motion-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  font-size: 11px;
}
.appearance-picker select {
  min-width: 76px;
  min-height: 29px;
  border: 1px solid #94b2c7;
  border-radius: 4px;
  padding: 3px 5px;
  background: #f6fbff;
}
.background-motion-control input { margin: 0; accent-color: #177cb6; }
.top-right { flex-wrap: wrap; min-width: 0; }
@media (max-width: 1000px) {
  .topbar { flex-wrap: wrap; }
  .top-right { flex: 1 1 auto; }
}
@media (pointer: coarse) {
  .appearance-picker, .background-motion-control { min-height: 44px; }
  .appearance-picker select { min-height: 44px; font-size: 16px; }
}
