body {
  font-family: Lato, sans-serif;
  background: #fff;
  color: #111;
  margin: 16px;
  line-height: 1.6em;

  --emoji-font-family: 'Twemoji Mozilla', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    'Noto Color Emoji', 'EmojiOne Color', 'Android Emoji';
  --emoji-box-border-radius: 4px;
}

.emoji-text {
  font-family: var(--emoji-font-family);
}

.image-link-description {
  visibility: hidden;
  position: absolute;
}

a {
  color: #00e;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* don't underline emoji part */
a.emoji-link {
  > .emoji-text {
    padding-right: 2px;
    letter-spacing: 2px;
  }

  &:hover {
    text-decoration: none !important;
    > .hover {
      text-decoration: underline;
    }
  }
}

emoji-check {
  display: block;
  user-select: none;

  span {
    filter: grayscale(1);
    font-family: var(--emoji-font-family);
  }
}

a:visited {
  color: #5518ab;
}

header {
  display: flex;
  align-items: flex-start;
  gap: 8px;

  .right {
    display: flex;
    flex-flow: column;
    gap: 8px;
  }

  h2 {
    line-height: 1em;
    font-size: 2em;
    margin: 0;

    display: flex;
    align-items: flex-start;
    gap: 8px;

    svg {
      display: block;
      width: 155px;
      height: 38px;
      margin-bottom: -6px;
    }
  }

  a.logo-home {
    &:hover {
      filter: drop-shadow(0 2px 0 #00e6);
    }

    img.logo {
      width: 32px;
      height: 32px;
      padding: 16px;
      margin: -16px;
      transform: translateY(4px); /* rip */
    }

    &:focus {
      outline: 0;

      img.logo {
        filter: hue-rotate(240deg);
      }
    }
  }
}

hr {
  height: 2px;
  background: #ccc;
  border: 0;
  margin: 16px 0;
}

img.emoji-preview {
  width: 128px;
  height: 128px;
}

main {
  /* l-r flex on desktop */
  display: flex;
  flex-flow: row;
  gap: 16px;

  @media screen and (max-width: 461px) {
    /* u-d */
    flex-flow: column wrap;
    align-items: flex-start;

    .emoji {
      flex-flow: row wrap !important;
      justify-content: center;
    }

    .tone-map {
      min-width: 200px;
    }
  }

  .emoji {
    display: flex;
    flex-flow: column;
    align-items: center;
    gap: 12px;
  }

  h1 {
    /* emoji rendered here */
    line-height: 1em;
    margin: 0;
    font-size: 6em;
  }

  .emoji-box {
    background: #f0f0f9;
    border-radius: var(--emoji-box-border-radius);
    min-width: 152px;
    min-height: 152px;
    box-sizing: content-box;
    display: flex;

    h1 {
      margin: auto;
    }
  }

  .info {
    flex-grow: 1;
  }

  emoji-copy[unresolved] {
    display: contents;

    h1 {
      transform: scale(0.75);
    }
  }
}

.tone-map {
  font-size: 1.2em;
  line-height: 1.4em;
  align-self: stretch;

  display: flex;
  align-items: stretch;
  flex-flow: column;

  .root {
    display: flex;
    flex-flow: row;
    justify-content: stretch;
  }

  a {
    border-radius: 4px;
    border: 2px solid white;
    text-align: center;
    flex-grow: 1;

    &:hover {
      text-decoration: none;
      background: #eef;
    }

    &:focus {
      outline: none;
      border-color: #0afaca;
    }
  }

  .tone-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    justify-content: center;
    text-align: center;
    border-top: 2px solid #ccc;
    margin-top: 4px;
    padding-top: 4px;
  }
}

.sub {
  display: flex;
  flex-flow: row wrap;
  gap: 0 1ch;

  h4 {
    font: inherit;
    margin: 0;
  }

  .row {
    display: contents;
  }
}

h5 {
  text-transform: uppercase;
  margin: 0;
  font-size: 0.8em;
  color: #444;
  letter-spacing: 0px;
}

.part {
  margin-bottom: 8px;
}

emoji-search {
  display: block;

  .search-bar {
    margin-bottom: 12px;
  }

  input {
    box-sizing: border-box;
    width: 100%;
    max-width: 320px;
    height: 36px;
    padding: 4px 10px;
    font: inherit;
    color: inherit;
    background: #f0f0f9;
    border: 2px solid transparent;
    border-radius: var(--emoji-box-border-radius);
    appearance: none;

    &::placeholder {
      color: #667;
    }

    &:focus {
      outline: 0;
      background: #fff;
      border-color: #00e;
    }

    &:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
  }

  .search-empty {
    color: #666;
    margin: 0;
  }
}

a.copied-flash {
  background: #0afaca;
  border-radius: var(--emoji-box-border-radius);
  transition: background 0.35s;
}

.copy-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #111e;
  color: #fff;
  border-radius: var(--emoji-box-border-radius);
  box-shadow: 0 4px 12px #0003;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.18s,
    transform 0.18s;

  &.visible {
    opacity: 1;
    transform: translateY(0);
  }
}
