:root {
  color-scheme: dark;
  --bg: #050906;
  --panel: #0a120d;
  --panel-strong: #111f17;
  --line: #1d3527;
  --text: #eefcf2;
  --muted: #91aa99;
  --green: #38f07c;
  --green-dark: #16a34a;
  --warning: #facc15;
  --danger: #fb7185;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(56, 240, 124, 0.16), transparent 24rem),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 22rem),
    radial-gradient(circle at bottom left, rgba(250, 204, 21, 0.08), transparent 20rem),
    linear-gradient(135deg, #030503 0%, #07110b 52%, #04070b 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(430px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 12px;
  background: rgba(3, 7, 4, 0.76);
}

.topbar,
.spec-summary,
.games-panel,
.spec-form {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 18, 13, 0.94);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 210px;
  padding: 24px 18px;
  border-radius: 0 0 10px 10px;
  backdrop-filter: blur(18px);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(17, 31, 23, 0.96), rgba(8, 18, 12, 0.94)),
    radial-gradient(circle at 50% 0%, rgba(56, 240, 124, 0.2), transparent 70%);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-logo {
  display: inline-block;
  margin: 0 0 12px;
  color: var(--green);
  font-size: 1.95rem;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
  background:
    linear-gradient(180deg, #e7ffef 0%, #9dffc0 38%, #59f58b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 320px;
  margin: 0 auto;
  font-size: 1.72rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 300px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.primary-action,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary-action {
  min-height: 50px;
  min-width: 190px;
  padding: 0 24px;
  border-radius: 8px;
  border: 1px solid rgba(196, 255, 213, 0.6);
  background:
    linear-gradient(180deg, #70ffa4 0%, var(--green) 48%, #16c95a 100%);
  color: #031006;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 12px 28px rgba(56, 240, 124, 0.24),
    0 0 0 4px rgba(56, 240, 124, 0.1);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.primary-action:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 16px 34px rgba(56, 240, 124, 0.3),
    0 0 0 4px rgba(56, 240, 124, 0.12);
}

.primary-action:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.18),
    0 8px 20px rgba(56, 240, 124, 0.22),
    0 0 0 4px rgba(56, 240, 124, 0.1);
}

.wide {
  width: 100%;
}

.spec-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 10px;
}

.spec-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 13px 14px;
  background: rgba(17, 31, 23, 0.9);
}

.spec-summary .summary-heading {
  min-height: 48px;
  background:
    linear-gradient(90deg, rgba(56, 240, 124, 0.16), rgba(56, 189, 248, 0.09)),
    #0b1710;
}

.summary-heading span {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.summary-heading button {
  min-height: 34px;
  border: 1px solid #2a4936;
  border-radius: 7px;
  background: #102119;
  color: var(--green);
  cursor: pointer;
  font-weight: 850;
  padding: 0 12px;
}

.spec-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.spec-summary strong {
  display: block;
  text-align: right;
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.games-panel {
  border-radius: 10px;
  padding: 16px;
}

.spec-form input,
.spec-form select {
  width: 100%;
  height: 50px;
  margin-bottom: 10px;
  border: 1px solid #2a4936;
  border-radius: 6px;
  background: #07110b;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.spec-form input:focus,
.spec-form select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(56, 240, 124, 0.16);
}

.panel-heading,
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading p,
.note {
  color: var(--muted);
}

.panel-heading span {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 800;
}

.game-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.game-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent, var(--green)) 16%, transparent), transparent 62%),
    #07110b;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.game-card::before {
  content: "";
  width: 4px;
  height: 42px;
  border-radius: 999px;
  background: var(--accent, var(--green));
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: start;
}

.game-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: 12px;
}

.game-logo {
  display: grid;
  flex: 0 0 auto;
  width: 64px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #06100a;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  overflow: hidden;
  box-shadow:
    inset 0 0 22px rgba(56, 240, 124, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.32);
}

.game-logo img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.game-logo span {
  grid-area: 1 / 1;
}

.game-logo img:not(.failed) + span {
  display: none;
}

.game-logo img.failed {
  display: none;
}

.game-logo.light-logo {
  border-color: rgba(56, 240, 124, 0.28);
  background: #f4fff7;
  box-shadow:
    inset 0 -12px 20px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(56, 240, 124, 0.12);
}

.game-card:hover,
.game-card.active {
  border-color: color-mix(in srgb, var(--accent, var(--green)) 55%, rgba(255, 255, 255, 0.12));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent, var(--green)) 24%, transparent), transparent 66%),
    #0e1d15;
  transform: translateY(-1px);
}

.game-card strong {
  display: block;
  margin-bottom: 4px;
}

.game-card span,
.game-card small {
  color: var(--muted);
}

.game-main strong,
.game-main span:not(.game-logo) {
  overflow-wrap: anywhere;
}

.game-card small {
  align-self: center;
  font-weight: 800;
}

.hidden {
  display: none;
}

.detail-view {
  min-height: calc(100vh - 24px);
  padding: 14px 0 22px;
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 12px 4px 14px;
  background: rgba(3, 7, 4, 0.92);
  backdrop-filter: blur(18px);
}

.back-button {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #254832;
  border-radius: 8px;
  background: #0b1710;
  color: var(--green);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 900;
}

.detail-header span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.detail-hero,
.detail-specs {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 18, 13, 0.94);
  box-shadow: var(--shadow);
}

.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 88px;
  margin-bottom: 12px;
  padding: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent, var(--green)) 18%, transparent), transparent 68%),
    rgba(10, 18, 13, 0.94);
}

.detail-logo {
  display: grid;
  width: 126px;
  height: 68px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(56, 240, 124, 0.2);
  border-radius: 8px;
  background: #06100a;
}

.detail-logo.light-logo {
  background: #f4fff7;
}

.detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

.detail-logo span {
  color: var(--green);
  font-weight: 950;
}

.detail-hero strong {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(56, 240, 124, 0.13);
  color: var(--green);
  font-size: 0.82rem;
}

.detail-specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-bottom: 14px;
  overflow: hidden;
}

.detail-specs div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  background: rgba(17, 31, 23, 0.9);
}

.detail-specs .detail-section-label {
  min-height: 44px;
  background: #0b1710;
}

.detail-section-label span {
  color: var(--text);
  font-size: 0.95rem;
}

.detail-specs span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-specs strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.fps-meter {
  margin: 26px 0;
}

.fps-meter span {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 2.35rem;
  font-weight: 950;
}

.meter-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #18251d;
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-dark), var(--accent, var(--green)));
  transition: width 240ms ease;
}

.fps-table-wrap {
  overflow-x: auto;
  border: 1px solid #213d2d;
  border-radius: 10px;
  background: #08120c;
}

.fps-table {
  width: 100%;
  min-width: 390px;
  border-collapse: collapse;
  text-align: left;
}

.fps-table th,
.fps-table td {
  padding: 12px 9px;
  border-bottom: 1px solid #193425;
}

.fps-table th {
  color: var(--muted);
  font-size: 0.8rem;
}

.fps-table td {
  font-weight: 850;
}

.fps-table tr:last-child td {
  border-bottom: 0;
}

.fps-table td:not(:first-child) {
  color: var(--green);
}

.note {
  margin: 18px 0 0;
  line-height: 1.55;
}

.spec-dialog {
  width: min(440px, calc(100% - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.spec-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.spec-form {
  padding: 22px;
  border-radius: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #16251c;
  color: var(--text);
  font-weight: 900;
}

@media (max-width: 940px) {
  .topbar {
    align-items: center;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: 100%;
    padding: 10px;
  }

  .topbar {
    padding: 16px;
  }

  .primary-action {
    min-width: 180px;
    padding: 0 16px;
  }

  .game-card {
    grid-template-columns: 1fr auto;
  }
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: start center;
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border: 1px solid #1d3929;
    border-radius: 28px;
    box-shadow:
      0 0 0 10px #020403,
      0 30px 90px rgba(0, 0, 0, 0.55);
    overflow: hidden;
  }
}
