@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --shell-red: #de1c26;
  --shell-red-dark: #ba1620;
  --shell-edge: #1d1d22;
  --shell-edge-soft: #5b1116;
  --light-gray: #dcdcdc;
  --screen-gray: #5f6062;
  --screen-inner: #8b8b8b;
  --black: #1a1b1f;
  --black-soft: #4d4f54;
  --blue: #19a9e3;
  --blue-dark: #0a78b0;
  --yellow: #f0e51a;
  --green: #0ea260;
  --home-green: #3cb643;
  --cyan: #1fbac3;
  --desk-bg: #d8c7a1;
  --pixel-font: "Press Start 2P", system-ui, sans-serif;

  /* Move the searched Pokémon name/number block here */
  --overview-info-offset-x: 8px;
  --overview-info-offset-y: -8px;

  --power-btn-transform: translateX(-15px) translateY(10px);
  --home-btn-transform: translateX(-15px) translateY(30px);
  --dpad-transform: translateX(20px) translateY(-10px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--desk-bg);
  color: #111;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

input,
button {
  -webkit-tap-highlight-color: transparent;
}

.desk {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.dex {
  width: min(94vw, 460px);
  aspect-ratio: 768 / 1024;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.22));
}

.dex-shell {
  position: relative;
  width: 100%;
  height: 100%;
  border: 6px solid var(--shell-edge);
  border-radius: 30px;
  background: linear-gradient(180deg, #df202a 0%, var(--shell-red) 58%, var(--shell-red-dark) 100%);
  overflow: hidden;
}

.dex-inner-outline {
  position: absolute;
  inset: 10px;
  border: 3px solid rgba(29, 29, 34, 0.85);
  border-radius: 24px;
  pointer-events: none;
}

.dex-top {
  position: absolute;
  inset: 0 0 auto 0;
  height: 21%;
}

.speaker-lens {
  position: absolute;
  z-index: 3;
  left: 7.2%;
  top: 18%;
  width: 18.7%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid #ffffff;
  background: radial-gradient(circle at 34% 30%, #6de4ff 0%, #19a9e3 30%, #1187c6 58%, #0e6ca2 78%, #0b4267 100%);
  box-shadow:
    0 0 0 3px var(--shell-edge),
    inset 6px 6px 10px rgba(255, 255, 255, 0.18),
    inset -8px -8px 12px rgba(0, 0, 0, 0.16);
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.speaker-lens::after {
  content: "";
  position: absolute;
  top: 16%;
  left: 20%;
  width: 24%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(1px);
}

.speaker-lens.speaking {
  box-shadow:
    0 0 0 3px var(--shell-edge),
    0 0 0 8px rgba(20, 189, 255, 0.18),
    0 0 28px rgba(45, 199, 255, 0.95),
    inset 6px 6px 10px rgba(255, 255, 255, 0.18),
    inset -8px -8px 12px rgba(0, 0, 0, 0.16);
}

.status-lights {
  position: absolute;
  z-index: 3;
  top: 18%;
  left: 30.2%;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
}

.status-light {
  flex: 0 0 auto;
  width: clamp(12px, 3.2vw, 18px);
  height: clamp(12px, 3.2vw, 18px);
  border-radius: 50%;
  border: 3px solid var(--shell-edge);
  background: #421116;
  opacity: 0.58;
  filter: brightness(0.78);
  transition: opacity 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.status-light.red { background: #ff3535; }
.status-light.yellow { background: #ffe81a; }
.status-light.green { background: #11b86b; }

.status-light.on.red {
  opacity: 1;
  filter: brightness(1.2);
  box-shadow: 0 0 16px rgba(255, 57, 57, 0.9);
}

.status-light.on.yellow {
  opacity: 1;
  filter: brightness(1.2);
  box-shadow: 0 0 16px rgba(255, 232, 26, 0.9);
}

.status-light.on.green {
  opacity: 1;
  filter: brightness(1.2);
  box-shadow: 0 0 16px rgba(17, 184, 107, 0.9);
}

.accent-lines {
  position: absolute;
  z-index: 1;
  left: 10;
  top: 68%;
  width: 95.4%;
  height: 28%;
  overflow: visible;
}

.accent-lines polyline {
  fill: none;
  stroke: var(--shell-edge);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.screen-module {
  position: absolute;
  left: 10.1%;
  top: 22.8%;
  width: 80.2%;
  height: 53.4%;
}

.screen-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border: 4px solid var(--shell-edge);
  background: linear-gradient(180deg, #efefef 0%, var(--light-gray) 100%);
  clip-path: polygon(4% 0, 100% 0, 100% 98%, 12% 98%, 0 86%, 0 4%);
  border-radius: 18px;
  box-shadow: inset 0 8px 10px rgba(255, 255, 255, 0.35), inset 0 -8px 10px rgba(0, 0, 0, 0.08);
}

.screen-top-leds {
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
}

.tiny-red-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef2530;
}

.main-screen {
  position: absolute;
  left: 10.5%;
  top: 8.6%;
  width: 79%;
  height: 70.5%;
  border: 4px solid var(--screen-inner);
  background: linear-gradient(180deg, #707174 0%, var(--screen-gray) 100%);
  overflow: hidden;
  color: #effcff;
}

.main-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.08));
  pointer-events: none;
}

.screen-bottom-bar {
  position: absolute;
  left: 11%;
  right: 11%;
  bottom: 4.8%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.mark-button {
  width: clamp(20px, 8.6%, 32px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #ff7b88 0%, #ff2436 48%, #c40817 100%);
  border: 4px solid var(--shell-edge);
  box-shadow: inset 4px 4px 6px rgba(255, 255, 255, 0.12), inset -6px -6px 7px rgba(0, 0, 0, 0.18);
}

.mark-button.marked {
  box-shadow: inset 4px 4px 6px rgba(255, 255, 255, 0.12), inset -6px -6px 7px rgba(0, 0, 0, 0.18), 0 0 16px rgba(255, 53, 89, 0.85);
}

.speaker-grille {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 20%;
  align-items: flex-end;
  padding-bottom: 4px;
}

.speaker-grille span {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--shell-edge);
}

.speaker-grille span:nth-child(1) { width: 100%; }
.speaker-grille span:nth-child(2) { width: 100%; }
.speaker-grille span:nth-child(3) { width: 100%; }
.speaker-grille span:nth-child(4) { width: 100%; }

.controls {
  position: absolute;
  left: 10.2%;
  right: 10.2%;
  top: 75.2%;
  bottom: 8.6%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}

.controls-upper {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.8vw, 14px);
  padding-left: 1.8%;
}

.power-button {
  width: clamp(44px, 14.5%, 62px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6e737a 0%, #3e434a 36%, #2a2e34 60%, var(--black) 100%);
  border: 4px solid var(--shell-edge);
  box-shadow: inset 4px 4px 7px rgba(255, 255, 255, 0.08), inset -8px -8px 8px rgba(0, 0, 0, 0.22);
  transform: var(--power-btn-transform);
}

.pill-button {
  width: clamp(56px, 16%, 76px);
  height: clamp(10px, 2.6vw, 14px);
  border-radius: 999px;
  border: 3px solid var(--shell-edge);
  box-shadow: inset 0 3px 4px rgba(255, 255, 255, 0.1), inset 0 -3px 4px rgba(0, 0, 0, 0.18);
}

.pill-red {
  background: linear-gradient(180deg, #ff3d47 0%, #f1232c 100%);
}

.pill-blue {
  background: linear-gradient(180deg, #2ad1d6 0%, #18aeb5 100%);
}

.controls-lower {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 9% 0 24%;
  transform: translateY(-38px);
}

.home-button {
  width: min(38%, 138px);
  margin-left: 0;
  min-height: 54px;
  aspect-ratio: 1.95 / 1;
  border-radius: 10px;
  border: 4px solid var(--shell-edge);
  background: linear-gradient(180deg, #46c84d 0%, var(--home-green) 100%);
  box-shadow: inset 0 6px 8px rgba(255, 255, 255, 0.08), inset 0 -6px 8px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6px 10px;
  transform: var(--home-btn-transform);
}

.mini-lcd {
  font-family: var(--pixel-font);
  font-size: 0.44rem;
  line-height: 1.35;
  color: #17361e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dpad {
  position: relative;
  width: clamp(94px, 27%, 112px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  transform: var(--dpad-transform);
}

.dpad-arm,
.dpad-center {
  position: absolute;
  background: linear-gradient(180deg, #56585f 0%, var(--black-soft) 55%, #34363b 100%);
  border: 4px solid var(--shell-edge);
  box-shadow: inset 4px 4px 5px rgba(255, 255, 255, 0.06), inset -6px -7px 8px rgba(0, 0, 0, 0.18);
}

.dpad-arm.up,
.dpad-arm.down {
  width: 30.5%;
  height: 39.5%;
  left: 34.75%;
}

.dpad-arm.left,
.dpad-arm.right {
  width: 39.5%;
  height: 30.5%;
  top: 34.75%;
}

.dpad-arm.up { top: 0; border-radius: 8px 8px 3px 3px; }
.dpad-arm.down { bottom: 0; border-radius: 3px 3px 8px 8px; }
.dpad-arm.left { left: 0; border-radius: 8px 3px 3px 8px; }
.dpad-arm.right { right: 0; border-radius: 3px 8px 8px 3px; }

.dpad-center {
  top: 34.75%;
  left: 34.75%;
  width: 30.5%;
  height: 30.5%;
  border-radius: 50%;
}

.dpad-center::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46%;
  height: 46%;
  border-radius: 50%;
  border: 3px solid var(--shell-edge);
  background: #5a5d63;
}

.control-btn {
  transition: transform 0.12s ease, filter 0.12s ease;
}

.control-btn:hover,
.control-btn:focus-visible {
  filter: brightness(1.03);
  outline: none;
}

.power-button.control-btn:hover,
.power-button.control-btn:focus-visible {
  transform: var(--power-btn-transform);
}

.home-button.control-btn:hover,
.home-button.control-btn:focus-visible {
  transform: var(--home-btn-transform);
}

.dpad.control-btn:hover,
.dpad.control-btn:focus-visible {
  transform: var(--dpad-transform);
}

.pill-button.control-btn:hover,
.pill-button.control-btn:focus-visible,
.mark-button.control-btn:hover,
.mark-button.control-btn:focus-visible {
  transform: translateY(-1px);
}

.screen-view {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 8px;
  background: rgba(17, 27, 34, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.screen-path,
.screen-title,
.menu-list,
.menu-list li,
.search-submit,
.search-pill,
.type-card,
.gen-card,
.tab-btn,
.list-item-number,
.list-item-name,
.list-footer,
.filter-helper,
.loading-view strong,
.error-view strong {
  font-family: var(--pixel-font);
}

.screen-path {
  font-size: 0.48rem;
  color: #e0f7ff;
  opacity: 0.82;
}

.screen-title {
  font-size: 0.62rem;
  line-height: 1.35;
  text-align: right;
  color: #fff;
}

.screen-tabs {
  display: grid;
  grid-template-columns: repeat(var(--tab-count, 5), minmax(0, 1fr));
  gap: 4px;
  padding: 5px 8px 0;
  flex: 0 0 auto;
}

.tab-btn {
  padding: 6px 3px;
  border-radius: 8px;
  background: rgba(16, 31, 39, 0.4);
  color: #effcff;
  font-size: 0.4rem;
  line-height: 1.25;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.menu-body,
.search-body,
.filter-body,
.list-body,
.overview-body,
.detail-body,
.evolution-body,
.error-view,
.loading-view,
.powered-off-view {
  padding: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.overview-onepanel {
  padding-top: 6px;
}

.overview-panel {
  position: relative;
  min-height: 100%;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
}

.overview-bubbles {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.evo-preview.small {
  pointer-events: auto;
  width: 42px;
  height: 42px;
}

.evo-preview.small .evo-preview-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.22);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.evo-preview.small img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.overview-main-art {
  width: 100%;
  max-width: 108px;
  max-height: 104px;
  object-fit: contain;
  align-self: center;
  margin-top: 16px;
  transform: translateX(14px);
}

.overview-info-corner {
  position: absolute;
  top: 54px;
  right: 8px;
  width: 118px;
  display: flex;
  justify-content: flex-end;
  z-index: 2;
}

.overview-info-card {
  width: 118px;
  padding: 8px 8px 7px;
  text-align: right;
  transform: none;
}

.overview-info-card .dex-number,
.overview-info-card .dex-name,
.overview-info-card .dex-category {
  overflow-wrap: anywhere;
  line-height: 1.12;
}

.overview-info-card .dex-name {
  font-size: 0.72rem;
}

.overview-info-card .dex-category {
  font-size: 0.62rem;
}

.cry-play-btn {
  width: 100%;
  padding: 8px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  font-family: var(--pixel-font);
  font-size: 0.4rem;
}

.menu-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-list li {
  font-size: 0.42rem;
  line-height: 1.25;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(10, 19, 24, 0.28);
  color: #effcff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-list li.selected {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: translateX(4px);
}

.menu-note,
.screen-copy,
.detail-copy,
.filter-helper,
.quick-value,
.quick-label,
.evo-trigger,
.evo-name,
.dex-name,
.dex-number,
.dex-category,
.stat-name,
.stat-value,
.search-input-wrap input,
.search-suggestions button,
.search-empty,
.list-header,
.list-subhead,
.list-footer {
  font-family: Arial, Helvetica, sans-serif;
}

.menu-note,
.filter-helper,
.search-empty,
.list-subhead,
.quick-label,
.dex-category,
.stat-name,
.evo-trigger {
  color: #d7eff8;
}

.menu-note,
.search-empty,
.list-subhead,
.quick-value,
.quick-label,
.dex-category,
.stat-name,
.stat-value,
.filter-helper,
.screen-copy,
.detail-copy,
.list-header,
.list-footer,
.evo-name,
.evo-trigger,
.dex-number,
.dex-name {
  font-size: 0.74rem;
}

.search-input-wrap {
  display: flex;
  gap: 8px;
}

.search-input-wrap input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: rgba(9, 15, 19, 0.56);
  color: #fff;
  padding: 10px 12px;
  outline: none;
}

.search-input-wrap input:focus {
  border-color: #bcefff;
}

.search-submit {
  min-width: 68px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.42rem;
  line-height: 1.3;
}

.search-suggestions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 142px;
  overflow: auto;
  padding-right: 4px;
}

.search-suggestions button {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 6px;
  text-align: left;
  border-radius: 10px;
  padding: 8px 10px;
  color: #f2fcff;
  background: rgba(8, 14, 18, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-suggestions button.selected,
.search-suggestions button:hover {
  background: rgba(255, 255, 255, 0.14);
}


.filter-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: none;
  overflow: hidden;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.type-list-card,
.gen-list-card {
  min-height: 44px;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(8, 14, 18, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  align-items: center;
  color: #fff;
  line-height: 1.25;
  text-align: left;
}

.type-list-card {
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
}

.gen-list-card {
  grid-template-columns: 1fr;
  font-family: var(--pixel-font);
  font-size: 0.58rem;
}

.type-list-card.selected,
.gen-list-card.selected {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 2px rgba(198, 241, 255, 0.55) inset;
}

.type-list-card.cursor,
.gen-list-card.cursor {
  border-color: rgba(255, 244, 168, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 244, 168, 0.35) inset;
}

.type-list-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.type-list-icon img {
  width: 20px;
  height: 20px;
}

.type-list-label {
  font-size: 0.76rem;
}

.type-list-state {
  font-family: var(--pixel-font);
  font-size: 0.44rem;
  color: #fff4a8;
}

.screen-action-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  font-family: var(--pixel-font);
  font-size: 0.46rem;
}

.screen-action-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.type-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.type-chip-selected {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.54rem;
}

.list-header {
  color: #fff;
  font-weight: 700;
  margin-bottom: 6px;
}

.list-scroll {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: none;
  overflow: hidden;
  padding-right: 0;
}

.list-item {
  display: grid;
  grid-template-columns: 32px 56px 1fr;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(8, 14, 18, 0.38);
  color: #f0fbff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.list-item.selected {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.list-item-avatar,
.suggestion-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.list-item-avatar img,
.suggestion-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.list-item-number {
  font-size: 0.48rem;
  line-height: 1.3;
}

.list-item-name {
  font-size: 0.6rem;
  line-height: 1.22;
}

.list-footer {
  margin-top: 10px;
}

.overview-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.art-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 14, 18, 0.32);
  display: grid;
  place-items: center;
  min-height: 102px;
}

.art-card img {
  width: 100%;
  max-width: 82px;
  height: auto;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.34));
}

.info-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.name-block,
.quick-box,
.stat-card,
.detail-card,
.detail-copy,
.evo-card {
  background: rgba(8, 14, 18, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.name-block,
.quick-box,
.stat-card,
.detail-card,
.detail-copy {
  padding: 10px;
}

.dex-number {
  color: #fff4a8;
  font-weight: 700;
  font-size: 0.78rem;
}

.dex-name {
  margin-top: 4px;
  font-size: 0.84rem;
  color: #fff;
  font-weight: 800;
}

.type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.54rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quick-grid,
.stats-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.quick-label {
  display: block;
  margin-bottom: 4px;
}

.stat-card-title,
.detail-card-title {
  color: #b8f0ff;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-row {
  display: grid;
  grid-template-columns: 54px 30px 1fr;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
}

.stat-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8ce3ff 0%, #6fffb2 100%);
}

.evolution-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.evo-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 158px;
  overflow: auto;
  padding-right: 4px;
}

.evo-card {
  min-width: 108px;
  padding: 10px;
  text-align: center;
  color: #fff;
}

.evo-card.current {
  box-shadow: 0 0 0 2px rgba(188, 239, 255, 0.58) inset;
}

.evo-card img {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
}



.profile-body,
.cry-body {
  padding: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.profile-body {
  padding-top: 4px;
}

.profile-body .detail-card.full {
  transform: translateY(-4px);
}

.profile-grid .full,
.detail-card.full,
.stat-card.full {
  grid-column: 1 / -1;
}

.overview-compact {
  padding-top: 6px;
}

.overview-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.evo-preview {
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.evo-preview-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.evo-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.evo-preview-label {
  font-size: 0.38rem;
  line-height: 1.2;
  color: #eafaff;
  overflow-wrap: anywhere;
}

.evo-preview.empty {
  opacity: 0.22;
  pointer-events: none;
}

.art-card.large {
  min-height: 120px;
}

.art-card.large img {
  max-width: 96px;
}

.name-block.center,
.name-block.compact {
  text-align: center;
}

.type-row.centered {
  justify-content: center;
  margin-top: 6px;
}

.full-height {
  min-height: 136px;
  display: flex;
  align-items: flex-start;
}

.evolution-body.compact {
  overflow: hidden;
}

.evo-chain.compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.evo-chain.compact::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.evo-card.compact {
  min-width: 0;
  padding: 6px 4px;
}

.evo-card.compact.circle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.evo-card.compact.circle-card img {
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.22);
}

.evo-card.compact .evo-name {
  font-size: 0.58rem;
  line-height: 1.15;
}

.evo-card.compact .evo-trigger {
  font-size: 0.44rem;
  line-height: 1.15;
}

.cry-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.cry-art {
  min-height: 104px;
  width: 100%;
}

.cry-art img {
  max-width: 90px;
}

.cry-play-btn {
  width: 100%;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  font-family: var(--pixel-font);
  font-size: 0.44rem;
}

.stats-only .stat-row:last-child {
  margin-bottom: 0;
}

.loading-view,
.error-view,
.powered-off-view {
  display: grid;
  place-items: center;
  text-align: center;
  color: #effcff;
}

.loading-view strong,
.error-view strong {
  font-size: 0.54rem;
  line-height: 1.5;
}

.powered-off-view {
  background: #000;
}

.hidden {
  display: none !important;
}

.list-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.list-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.screen-header {
  flex: 0 0 auto;
}

.list-item-number,
.list-item-name {
  white-space: nowrap;
}

.screen-path,
.screen-title {
  white-space: normal;
}

.list-item-name,
.screen-copy,
.detail-copy,
.quick-value,
.dex-category {
  overflow-wrap: anywhere;
}

.search-suggestions button > span:last-child {
  min-width: 0;
}


.main-screen > * {
  min-height: 0;
}

.suggestion-text {
  min-width: 0;
  font-size: 0.62rem;
  line-height: 1.18;
}

@media (max-height: 760px) {
  .screen-title {
    font-size: 0.5rem;
  }

  .menu-note,
  .search-empty,
  .list-subhead,
  .quick-value,
  .quick-label,
  .dex-category,
  .stat-name,
  .stat-value,
  .filter-helper,
  .screen-copy,
  .detail-copy,
  .list-header,
  .list-footer,
  .evo-name,
  .evo-trigger,
  .dex-number,
  .dex-name {
    font-size: 0.72rem;
  }

  .screen-btn {
    font-size: 0.54rem;
    padding: 6px 7px;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--desk-bg);
  }

  .desk {
    padding: 0;
    place-items: stretch;
  }

  .dex {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    filter: none;
  }

  .dex-shell {
    border-radius: 0;
    border-width: 0;
  }

  .dex-inner-outline {
    inset: max(env(safe-area-inset-top), 8px) 8px max(env(safe-area-inset-bottom), 8px) 8px;
    border-radius: 26px;
  }

  .screen-module {
    top: calc(22.8% + env(safe-area-inset-top) * 0.05);
    height: 53.4%;
  }

  .controls {
    top: 75.2%;
    bottom: max(env(safe-area-inset-bottom), 8px);
  }
}

@media (max-width: 420px) {
  .controls-upper {
    gap: 8px;
  }

  .power-button {
    width: 44px;
  }

  .pill-button {
    width: 62px;
  }

  .home-button {
    width: 40%;
    min-height: 48px;
  }

  .dpad {
    width: min(34%, 110px);
  }

  .main-screen {
    left: 10.5%;
    top: 8.4%;
    width: 79%;
    height: 71%;
  }

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

  .overview-body {
    grid-template-columns: 1fr;
  }

  .art-card {
    min-height: 94px;
  }

  .controls-lower {
    padding-left: 12%;
    transform: translateY(-14px);
  }

  .dpad {
    --dpad-transform: translateX(20px) translateY(-18px);
    transform: var(--dpad-transform);
  }

  .art-card img {
    max-width: 76px;
  }

  .quick-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.pokemon-info-position {
  transform: translate(var(--overview-info-offset-x), var(--overview-info-offset-y));
}


.detail-copy-scroll {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  line-height: 1.45;
  font-size: 0.8rem;
}

.detail-copy-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}


.dex.powered-off .main-screen {
  background: #000;
  border-color: #2a2a2a;
}

.dex.powered-off .speaker-lens {
  filter: brightness(0.45) saturate(0.6);
  box-shadow:
    0 0 0 3px var(--shell-edge),
    inset 6px 6px 10px rgba(255, 255, 255, 0.1),
    inset -8px -8px 12px rgba(0, 0, 0, 0.18);
}

.dex.powered-off .status-light {
  opacity: 0.22;
  filter: brightness(0.45);
  box-shadow: none;
}

.dex.powered-off .home-button {
  background: linear-gradient(180deg, #1f2223 0%, #111315 100%);
}

.dex.powered-off .mini-lcd {
  color: transparent;
}


@media (max-width: 420px) {
  .tab-btn {
    font-size: 0.34rem;
  }

  .type-list-label,
  .detail-copy-scroll,
  .list-item-name {
    font-size: 0.68rem;
  }

  .list-item-number {
    font-size: 0.44rem;
  }

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