/* Default styling in all modes. */

html {
  font-family: sans-serif;
}

body {
  margin: 0;
}

/* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd */
kbd {
  background-color: #eee;
  border-radius: 3px;
  border: 1px solid #b4b4b4;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.2),
    0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
  color: #333;
  display: inline-block;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  white-space: nowrap;
}

a#play {
  display: inline-block;
  position: relative;
  overflow: hidden;

  width: 16ex;
  height: 9ex;
  line-height: 9ex;

  font-size: 5vh;
  text-decoration: none;
  text-align: center;

  border: 2px solid indigo;
  border-radius: 0.5ex;

  color: white;
  text-shadow: 0 0 2px indigo, 0 0 0.5ex black;
  transition: background 0.2s ease-out;
}

a#play:hover {
  background: rgba(0, 0, 0, 0.5);
  transition: background 0.2s ease-out;
}

a#play img {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: -1;
}

summary {
  font-size: 150%;
}

karaoke {
  display: block;
  background: darkgrey;
  color: white;
  padding: 1ex 0;

  font: 4vh sans-serif;
}

karaoke audio {
    display: block;
    position: sticky;
    margin: auto;
    width: 80%;
    top: 2ex;
    z-index: 1;
}

karaoke verse {
  display: block;
  position: relative;
  border: 1px solid white;
  padding: 1ex;
  margin: 1em;
}

karaoke *:focus {
  outline: none;
}

karaoke background {
  /* Do not display the background in inline mode. */
  display: none;
}

karaoke p {
  margin: auto;
  text-align: center;

  /* Instead of using italics font, use upright font but make it oblique. */
  transform: skewX(-15deg);
}

karaoke a {
  display: inline-block;
  position: relative;

  color: white;
  text-decoration: none;
  text-shadow:
    2px 2px 0 black,
    -2px 2px 0 black,
    -2px -2px 0 black,
    2px -2px 0 black;
}

@keyframes animate-flare {
  0% {
    transform: scale(1);
    text-shadow:
      /* Black outline pulsing to yellow and back. */
      2px 2px 0 black,
      -2px 2px 0 black,
      -2px -2px 0 black,
      2px -2px 0 black,
      /* Nearfield effect. */
      4px 4px 0 rgba(255, 255, 255, 1),
      -4px 4px 0 rgba(255, 255, 255, 1),
      -4px -4px 0 rgba(255, 255, 255, 1),
      4px -4px 0 rgba(255, 255, 255, 1),
      /* Farfield effect. */
      4px 4px 0 rgba(255, 255, 255, 1),
      -4px 4px 0 rgba(255, 255, 255, 1),
      -4px -4px 0 rgba(255, 255, 255, 1),
      4px -4px 0 rgba(255, 255, 255, 1);
  }

  50% {
    transform: scale(1.25);
    text-shadow:
      /* Black outline pulsing to yellow and back. */
      2px 2px 2px yellow,
      -2px 2px 2px yellow,
      -2px -2px 2px yellow,
      2px -2px 2px yellow,
      /* Nearfield effect. */
      4px 4px 2ex rgba(255, 255, 255, 1),
      -4px 4px 2ex rgba(255, 255, 255, 1),
      -4px -4px 2ex rgba(255, 255, 255, 1),
      4px -4px 2ex rgba(255, 255, 255, 1),
      /* Farfield effect. */
      4px 4px 2ex rgba(255, 255, 255, 0.5),
      -4px 4px 2ex rgba(255, 255, 255, 0.5),
      -4px -4px 2ex rgba(255, 255, 255, 0.5),
      4px -4px 2ex rgba(255, 255, 255, 0.5);
  }

  100% {
    transform: scale(1);
    text-shadow:
      /* Black outline pulsing to yellow and back. */
      2px 2px 0 black,
      -2px 2px 0 black,
      -2px -2px 0 black,
      2px -2px 0 black,
      /* Nearfield effect. */
      4px 4px 0 rgba(255, 255, 255, 0),
      -4px 4px 0 rgba(255, 255, 255, 0),
      -4px -4px 0 rgba(255, 255, 255, 0),
      4px -4px 0 rgba(255, 255, 255, 0),
      /* Farfield effect. */
      4px 4px 4ex rgba(255, 255, 255, 0),
      -4px 4px 4ex rgba(255, 255, 255, 0),
      -4px -4px 4ex rgba(255, 255, 255, 0),
      4px -4px 4ex rgba(255, 255, 255, 0);
  }
}

karaoke a:focus {
  animation: animate-flare 0.3s;
}

karaoke todo {
  display: none;
}

/* Fullscreen styling. */

karaoke#fullscreen:target {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 0;

  overflow: scroll;

  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

karaoke#fullscreen:target background {
  display: block;
  position: fixed;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

karaoke#fullscreen:target verse {
  flex-shrink: 0;
  width: 100vw;
  margin: 0;
  border: 0;
  padding-top: 30%;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: column wrap;

  scroll-snap-align: start;
}

karaoke#fullscreen:target verse > * {
  flex-grow: 0;
  margin: 0;
}

karaoke#fullscreen:target verse a {
  pointer-events: none;
}

.fill {
  min-width: 100%;
  min-height: 100%;
  transform: translateX(calc((100vw - 100%) / 2));
}
