/* Safari 9 safe: flexbox with -webkit- prefixes, no grid, no gap, no CSS variables, no object-fit. */

* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #fff8e1;
  font-family: "Arial Rounded MT Bold", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.songs {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 10px;
}

.song {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  width: 46%;
  margin: 2%;
  padding: 0;
  border: 6px solid #fff;
  border-radius: 28px;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: #fff;
  -webkit-appearance: none;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  -webkit-box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
  position: relative;
  -webkit-transition: -webkit-transform 0.1s, -webkit-box-shadow 0.1s;
  transition: transform 0.1s, box-shadow 0.1s;
}

.song:active {
  -webkit-transform: scale(0.95);
  transform: scale(0.95);
}

.song:focus {
  outline: none;
}

.song-picture {
  width: 100%;
  /* Square picture: padding percentages are relative to the width. */
  height: 0;
  padding-bottom: 100%;
  position: relative;
  background-position: center;
  background-repeat: no-repeat;
  -webkit-background-size: cover;
  background-size: cover;
}

.song-emoji {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  margin-top: -0.5em;
  /* Kept small (iOS 9 caps color emoji size) and scaled up from JS: see fitEmoji in main.ts. */
  font-size: 48px;
  line-height: 1;
  text-align: center;
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
  -webkit-transform-origin: 50% 50%;
  transform-origin: 50% 50%;
}

.song-title {
  display: block;
  -webkit-box-flex: 1;
  -webkit-flex-grow: 1;
  flex-grow: 1;
  padding: 10px 8px 14px;
  font-size: 22px;
  font-weight: bold;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.12);
}

/* Playing: the button stays pushed in, darker, with a yellow border and a speaker badge. No looping animation. */
.song.is-playing {
  border-color: #ffeb3b;
  -webkit-transform: translateY(6px);
  transform: translateY(6px);
  -webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.song.is-playing::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.25);
}

.song.is-playing::before {
  content: "\1F50A";
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: #ffeb3b;
  font-size: 28px;
  line-height: 48px;
  text-align: center;
}

.error {
  font-size: 120px;
  padding-top: 80px;
  text-align: center;
}

/* Tablets (iPad portrait): 3 per row. */
@media (min-width: 600px) {
  .song {
    width: 29.3%;
  }
  .song-title {
    font-size: 26px;
  }
}

/* iPad landscape and larger: 4 per row. */
@media (min-width: 900px) {
  .song {
    width: 21%;
  }
}
