:root {
  color-scheme: dark;
  --bg: #101613;
  --surface: #18221d;
  --surface-soft: #203229;
  --ink: #f4f7ef;
  --muted: #a2afa5;
  --line: #2b3b32;
  --accent: #51d28d;
  --accent-strong: #75e4a6;
  --blue: #7bb7ff;
  --gold: #f0c461;
  --button-bg: #183454;
  --featured-border: #314635;
  --featured-glow-start: rgba(81, 210, 141, 0.18);
  --featured-glow-end: rgba(240, 196, 97, 0.14);
  --search-fade: rgba(16, 22, 19, 0);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-soft: #eef6ee;
  --ink: #171a16;
  --muted: #6b7168;
  --line: #e3e7df;
  --accent: #2da46f;
  --accent-strong: #147a55;
  --blue: #2d7eea;
  --gold: #b4811f;
  --button-bg: #e7f2ff;
  --featured-border: #dce8d9;
  --featured-glow-start: rgba(45, 164, 111, 0.16);
  --featured-glow-end: rgba(180, 129, 31, 0.13);
  --search-fade: rgba(247, 248, 244, 0);
  --shadow: 0 10px 30px rgba(19, 35, 24, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  touch-action: pan-y;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 27px;
  line-height: 1.08;
  font-weight: 800;
}

.profile-button,
.theme-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.profile-button {
  background: var(--ink);
  color: var(--bg);
}

.theme-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 17px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.search-panel {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, var(--bg) 78%, var(--search-fade));
}

.search-box {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.14);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.search-box input::placeholder {
  color: var(--muted);
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 0 14px;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-button {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.category-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.featured-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 22px;
  padding: 15px;
  border: 1px solid var(--featured-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--featured-glow-start), var(--featured-glow-end)),
    var(--surface);
}

.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.featured-copy h2 {
  max-width: 19rem;
  font-size: 17px;
  line-height: 1.25;
}

.featured-button,
.open-button {
  min-height: 34px;
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.featured-button {
  padding: 0 14px;
}

.app-section {
  margin-top: 22px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 11px;
}

.section-title h2 {
  font-size: 18px;
  line-height: 1.2;
}

.section-title span {
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.app-list {
  display: grid;
  gap: 12px;
}

.app-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 62px;
}

.app-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 26, 22, 0.13);
}

.app-info {
  min-width: 0;
}

.app-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.app-title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-badge {
  flex: 0 0 auto;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--button-bg);
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
}

.app-description {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-button {
  width: 48px;
}

.empty-state {
  padding: 26px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 560px) {
  .shell {
    padding-inline: 24px;
  }

  .app-list {
    grid-template-columns: 1fr 1fr;
    gap: 15px 18px;
  }

  .app-row {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
}
