:root {
  color-scheme: light;
  --bg: #efece3;
  --ink: #1a1914;
  --muted: #5e5a50;
  --card: #f7f4ec;
  --line: #d9d3c5;
  --playing: #1a1914;
  --playing-ink: #f6f3ea;
  --stop: #1a1914;
  --stop-ink: #f6f3ea;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121410;
    --ink: #f4f1e8;
    --muted: #a8a292;
    --card: #1c211c;
    --line: #32382f;
    --playing: #e4f07a;
    --playing-ink: #16180f;
    --stop: #f4f1e8;
    --stop-ink: #16180f;
  }
}

* {
  box-sizing: border-box;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding:
    calc(1.25rem + var(--safe-top))
    1rem
    calc(6.75rem + var(--safe-bottom));
}

.top,
.list,
.empty {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.mark {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0.2rem 0 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.status {
  min-height: 1.4rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

.sound {
  display: flex;
  width: 100%;
  min-height: 4.75rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sound-name {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.sound-tags {
  color: var(--muted);
  font-size: 0.85rem;
}

.sound.is-playing {
  border-color: var(--playing);
  background: var(--playing);
  color: var(--playing-ink);
}

.sound.is-playing .sound-tags {
  color: var(--playing-ink);
  opacity: 0.72;
}

.sound:active {
  transform: scale(0.985);
}

.stop-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0.75rem 1rem calc(0.75rem + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

#stop {
  display: block;
  width: min(32rem, 100%);
  min-height: 3.75rem;
  margin: 0 auto;
  border: 0;
  border-radius: 1rem;
  background: var(--stop);
  color: var(--stop-ink);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.empty {
  margin-top: 1rem;
  color: var(--muted);
}

#filter {
  display: block;
  width: min(32rem, 100%);
  min-height: 3rem;
  margin: 1rem auto 0;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: 1rem;
}

a {
  color: inherit;
}

button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .sound:active {
    transform: none;
  }
}
