:root {
  --tile-size: 100px;   /* matches the original 60px box + 20px padding, box-sizing aside */
  --icon-size: 30px;
  --gap: 20px;
  --radius: 10px;
  --scrim: rgba(0, 0, 0, 0.6);
  --scrim-hover: rgba(0, 0, 0, 0.8);
  --fg: #fff;
  --focus: #4da3ff;

  /* Hover growth, neutralised under prefers-reduced-motion (see below) so the
     media-query ordering never has to fight the responsive rules. */
  --strip-hover-scale: 1.05;
  --tile-hover-scale: 1.1;
  --tile-active-scale: 1.05;
  --anim: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --strip-hover-scale: 1;
    --tile-hover-scale: 1;
    --tile-active-scale: 1;
    --anim: 0s;
  }
}

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

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

body {
  /* The image is applied from portal.json; this colour shows while it loads
     and if the file is missing. */
  background-color: #1b2a33;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Tile strip ---------- */

.portal {
  position: fixed;
  top: 50%;
  right: var(--gap);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap);
  background-color: var(--scrim);
  border-radius: var(--radius);
  transition: transform var(--anim) ease-in-out;
}

.portal:hover {
  transform: translateY(-50%) scale(var(--strip-hover-scale));
}

/* The strip is empty until the config resolves — don't flash a bare box. */
.portal:empty {
  display: none;
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tile-size);
  height: var(--tile-size);
  border-radius: var(--radius);
  background-color: var(--scrim);
  color: var(--fg);
  text-decoration: none;
  transition: background-color var(--anim) ease, transform var(--anim) ease;
}

.tile:hover {
  background-color: var(--scrim-hover);
  transform: scale(var(--tile-hover-scale));
}

.tile:active {
  transform: scale(var(--tile-active-scale));
}

.tile:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.tile__icon {
  width: var(--icon-size);
  height: var(--icon-size);
  fill: currentColor;
  pointer-events: none;
}

/* ---------- Messages ---------- */

.notice {
  position: fixed;
  inset: auto 0 var(--gap) 0;
  margin: 0 auto;
  max-width: 32rem;
  padding: 16px 20px;
  border-radius: var(--radius);
  background-color: var(--scrim-hover);
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.notice p {
  margin: 0 0 0.5em;
}

.notice p:last-child {
  margin-bottom: 0;
}

/* ---------- Small screens: the strip becomes a bottom bar ---------- */

@media (max-width: 640px) {
  :root {
    --tile-size: 76px;
  }

  .portal {
    top: auto;
    right: auto;
    bottom: var(--gap);
    left: 50%;
    flex-direction: row;
    transform: translateX(-50%);
    max-width: calc(100vw - 2 * var(--gap));
    overflow-x: auto;
  }

  .portal:hover {
    transform: translateX(-50%) scale(var(--strip-hover-scale));
  }

  .tile {
    flex: 0 0 auto;
  }

  .notice {
    bottom: calc(var(--tile-size) + 3 * var(--gap));
  }
}
