/* Play's glass over the world (play/hud.js): the ticket counter, the prize card, numbers over the hoops, the race and hide and seek. */

#play .glyph,
#mirror-wear .glyph {
  display: block;
}

#prizes .pic .glyph {
  width: 100%;
  height: 100%;
}

#tickets {
  position: fixed;
  z-index: 3;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 6px 8px;
  border-radius: 999px;
  font: 700 19px var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  pointer-events: none;
}

#tickets .glyph {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 1px 2px rgba(150, 70, 0, 0.35));
}

#tickets.pop {
  animation: p-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes p-pop {
  30% {
    transform: scale(1.22);
    box-shadow: var(--rim), 0 0 26px 6px rgba(255, 214, 90, 0.75);
  }
}

#play .flier {
  position: fixed;
  z-index: 3;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.5, -0.3, 0.6, 1), opacity 0.6s ease-in;
}

/* Numbers and marks over things in the world. */
.ptag {
  position: fixed;
  z-index: 2;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.ptag.hoop {
  min-width: 38px;
  padding: 2px 10px 3px;
  border-radius: 10px;
  font: 800 20px var(--font);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #ffb35a, #ff6a1f);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(160, 60, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 1px rgba(120, 40, 0, 0.5);
}

.ptag.hoop.pop {
  animation: p-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}

/* The prize counter's card. */
#prizes {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  margin: auto;
  padding: 14px 16px 16px;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  font: 500 16px var(--font);
  background: var(--glass);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
}

#prizes[open] {
  position: fixed;
  inset: 0;
  z-index: 4;
}

#prizes header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

#prizes h2 {
  margin: 0;
  font: 700 21px var(--font);
}

#prizes .purse,
#prizes .price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 18px var(--font);
  font-variant-numeric: tabular-nums;
}

#prizes .purse .glyph,
#prizes .price .glyph {
  width: 28px;
  height: 28px;
}

#prizes .wares {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

#prizes .ware {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(220, 246, 255, 0.55));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 60, 130, 0.15);
  text-align: center;
}

#prizes .ware.owned {
  background: linear-gradient(180deg, rgba(235, 255, 225, 0.95), rgba(180, 240, 170, 0.6));
}

#prizes .pic {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 2px 3px rgba(0, 40, 90, 0.3));
}

#prizes .ware b {
  font: 600 15px var(--font);
}

#prizes button {
  min-width: 84px;
  padding: 6px 14px 7px;
  border: 0;
  border-radius: 999px;
  font: 700 15px var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #c9f1ff);
  box-shadow: inset 0 0 0 1px rgba(6, 48, 79, 0.2), 0 1px 3px rgba(0, 50, 110, 0.25);
  cursor: pointer;
}

#prizes .ware:not(.owned) button:not(:disabled) {
  background: linear-gradient(180deg, #ffe27a, #ffad2f);
}

#prizes button:disabled {
  opacity: 0.45;
  cursor: default;
}

#prizes .done {
  display: block;
  margin: 12px 0 0 auto;
}

/* What the mirror's card can put on, in three even columns: "Headphones" fits one, and a narrower phone breaks a
   name rather than widen its tile. */
#mirror-wear {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  overflow-wrap: anywhere;
}

#mirror-wear .wear {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 5px 5px;
  border: 0;
  border-radius: 12px;
  font: 600 13px/1.15 var(--font);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px rgba(6, 48, 79, 0.15);
  cursor: pointer;
}

#mirror-wear .wear .glyph {
  width: 34px;
  height: 34px;
}

#mirror-wear .wear[aria-pressed="true"] {
  background: linear-gradient(180deg, #e8fff0, #9ff0c0);
  box-shadow: inset 0 0 0 2px var(--ink);
}

@media (max-width: 520px) {
  #tickets {
    top: 14px;
    right: 12px;
  }
  #prizes .wares {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* A phone: the chat chip holds the top right corner, so the counter stands under it, and an open chat lies over it. */
:root[data-touch="true"] #tickets {
  z-index: 2;
  top: calc(56px + env(safe-area-inset-top));
  right: 10px;
}

/* The tour names its places in a band across the top of a phone; the counter steps out of it. */
@media (max-width: 700px) {
  :root[data-touch="true"] #caption:not([hidden]) ~ #play #tickets {
    visibility: hidden;
  }
}

/* The roof race: a clock while a lap runs, and the board. */
#race-clock,
#seek {
  position: fixed;
  z-index: 3;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 18px 5px 8px;
  border-radius: 999px;
  font: 700 22px var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  pointer-events: none;
}

#race-clock .glyph,
#seek .glyph {
  width: 30px;
  height: 30px;
}

#race-clock.done {
  background: linear-gradient(180deg, rgba(255, 252, 226, 0.95), rgba(255, 214, 120, 0.75));
  animation: p-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

#seek {
  top: 74px;
}

#seek[data-phase="count"] {
  background: linear-gradient(180deg, rgba(235, 250, 255, 0.92), rgba(140, 220, 255, 0.7));
}

#seek[data-phase="over"] b {
  color: #e8a400;
}

#race-board {
  position: fixed;
  z-index: 3;
  top: 76px;
  right: 20px;
  width: min(250px, calc(100vw - 40px));
  padding: 10px 14px 12px;
  border-radius: 18px;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  pointer-events: none;
}

#race-board h2 {
  margin: 0 0 6px;
  font: 700 17px var(--font);
}

#race-board ol {
  margin: 0;
  padding: 0;
  list-style: none;
  font: 500 15px var(--font);
}

#race-board li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 8px;
}

#race-board li i {
  font-style: normal;
  opacity: 0.6;
}

#race-board li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#race-board li b {
  font-variant-numeric: tabular-nums;
}

#race-board li.mine {
  background: linear-gradient(180deg, rgba(255, 246, 200, 0.95), rgba(255, 214, 120, 0.7));
}

/* Hide and seek: an eye over whoever is found, and the names of bots that play in this browser alone. */
.ptag.seeker-mark {
  display: flex;
  align-items: center;
  gap: 4px;
  font: 600 14px var(--font);
  color: var(--ink);
}

#play .ptag.seeker-mark .glyph {
  display: none;
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 3px rgba(0, 50, 110, 0.5));
}

#play .ptag.seeker-mark.found .glyph {
  display: block;
}

/* The room's name pill (aero.css .tag), standing in the mark rather than placed on its own. */
.ptag.seeker-mark .tag {
  position: static;
  opacity: 1;
}

@media (max-width: 520px) {
  #race-clock {
    top: 64px;
  }
  #seek {
    top: 112px;
  }
  #race-board {
    top: 116px;
    right: 12px;
  }
}
