:root {
  --bg: rgb(12, 14, 19);
  --fg: #e7e9ee;
  --muted: #7a8190;
  --line: #1f232d;
  --hover: #151821;
  --up: #5cc98a;
  --down: #ef5560;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #2a2f3a transparent;
}

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

select {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}

.logo {
  margin-right: auto;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

#mute {
  display: grid;
  padding: 4px;
  border: 0;
  background: none;
  cursor: pointer;
}

#mute svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#mute .off,
#mute.off .on {
  display: none;
}

#mute.off .off {
  display: inline;
}

#mute.off {
  color: var(--muted);
}

#mute.blocked {
  animation: pulse 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
  to {
    color: var(--fg);
  }
}

#volume {
  width: 72px;
  accent-color: var(--muted);
}

main {
  flex: 1;
  min-height: 0;
}

#discover {
  overflow-y: auto;
  padding: 0 16px;
}

#search {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 10vh auto 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: none;
  font-size: 16px;
  outline: none;
}

#search:focus {
  border-color: #363c4a;
}

#events {
  max-width: 640px;
  margin: 0 auto 48px;
  padding: 0;
  list-style: none;
}

#events a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
}

#events a:hover {
  background: var(--hover);
}

#events img {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

#events .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live {
  flex: none;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--down);
}

#events .volume {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

#market {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 16px;
}

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

#game {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
}

#markets {
  min-width: 0;
  max-width: 100%;
  margin-right: auto;
}

#range {
  display: flex;
  gap: 2px;
}

#range button {
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#range button.on {
  background: var(--hover);
  color: var(--fg);
}

#outcomes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

#outcomes button {
  display: grid;
  grid-template-areas: 'name name' 'value change';
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 10px;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: none;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

#outcomes button:last-child {
  grid-template-areas: 'name name' 'change value';
  grid-template-columns: 1fr auto;
  text-align: right;
}

#outcomes button.on {
  border-color: var(--color);
  color: var(--fg);
}

#outcomes span {
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* the side's color, as on the chart */
#outcomes span::before,
#outcomes button:last-child span::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: var(--color);
}

#outcomes button:last-child span::before {
  content: none;
}

#outcomes button:last-child span::after {
  margin: 0 0 1px 8px;
}

#outcomes b {
  grid-area: value;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

#outcomes i {
  grid-area: change;
  font-size: 15px;
  font-style: normal;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#outcomes i.up {
  color: var(--up);
}

#outcomes i.down {
  color: var(--down);
}

#chart {
  flex: 1;
  width: 100%;
  min-height: 260px;
}

@media (max-width: 640px) {
  #market {
    overflow-y: auto;
  }

  #outcomes b {
    font-size: 40px;
  }

  #chart {
    flex: none;
    height: 320px;
  }
}
