:root {
  --blue: #99ccff;
  --stage-w: 722px;
  --stage-h: 540px;
  --menu: 65px;
  --rail: 66px;
  --panel-w: 590px;
  --panel-h: 410px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--blue);
  font-family: Verdana, Geneva, sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.stage {
  width: var(--stage-w);
  height: var(--stage-h);
  display: grid;
  grid-template-columns: var(--rail) var(--panel-w) var(--rail);
  grid-template-rows: var(--menu) var(--panel-h) var(--menu);
  grid-template-areas:
    "top top top"
    "left content right"
    "bottom bottom bottom";
  flex-shrink: 0;
}

.menu-top {
  grid-area: top;
  position: relative;
  width: 100%;
  height: var(--menu);
}

.menu-left {
  grid-area: left;
  position: relative;
  width: var(--rail);
  height: var(--panel-h);
}

.menu-right {
  grid-area: right;
  position: relative;
  width: var(--rail);
  height: var(--panel-h);
}

.menu-bottom-wrap {
  grid-area: bottom;
  position: relative;
  width: 100%;
  height: var(--menu);
}

.menu-bottom {
  position: absolute;
  inset: 0;
}

.menu-btn {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.menu-btn img {
  display: block;
  image-rendering: auto;
}

.menu-btn:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 1px;
}

.content {
  grid-area: content;
  width: var(--panel-w);
  height: var(--panel-h);
  position: relative;
  overflow: hidden;
  background: #efefef;
}

.links {
  position: absolute;
  right: 66px;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  height: 41px;
  z-index: 2;
}

.links button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.links img {
  display: block;
  height: 23px;
  width: auto;
}

/* Home */
.home {
  width: 100%;
  height: 100%;
  background: var(--blue);
}

.home-hero {
  display: flex;
  width: 590px;
  height: 382px;
}

.home-hero img {
  display: block;
}

.home-bar {
  display: flex;
  width: 590px;
  height: 28px;
}

.home-contact {
  display: block;
  width: 201px;
  height: 28px;
  flex-shrink: 0;
}

.home-contact img,
.home-strip {
  display: block;
}

.home-strip {
  width: 389px;
  height: 28px;
}

/* Sound grid */
.sound-panel {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  grid-template-rows: 19px 1fr 18px;
}

.sound-grid {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, 157px);
  grid-template-rows: repeat(3, 125px);
  justify-content: center;
  align-content: center;
  justify-items: center;
  align-items: center;
}

.tile {
  width: 150px;
  height: 119px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  border-radius: 2px;
  transition: transform 120ms ease, filter 120ms ease;
}

.tile:hover {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.tile:active {
  transform: scale(0.98);
}

.tile:focus-visible {
  outline: 2px solid #336699;
  outline-offset: 2px;
}

.tile img {
  display: block;
  width: 150px;
  height: 119px;
  object-fit: contain;
}

.tile.is-playing::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 3px rgba(51, 102, 153, 0.55);
  pointer-events: none;
}

.tile.is-missing {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-arrow {
  grid-row: 2;
  align-self: center;
  justify-self: center;
  width: 33px;
  height: 33px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.nav-arrow img {
  display: block;
  width: 33px;
  height: 33px;
}

.nav-arrow.prev {
  grid-column: 1;
}

.nav-arrow.next {
  grid-column: 3;
}

.nav-arrow[hidden] {
  visibility: hidden;
  pointer-events: none;
}

/* Static pages */
.page-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ccc;
}

@media (max-width: 760px) {
  body {
    align-items: flex-start;
    padding: 8px;
  }

  .stage {
    transform-origin: top center;
    transform: scale(min(1, calc((100vw - 16px) / 722)));
  }
}
