@font-face {
  font-family: "Sazanami Gothic";
  src: url("/fonts/sazanami-gothic.woff2?v=5") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #ffffff;
  --slab: #ffffff;
  --button: #a08bed;
  --name-color: #3f5f9e;
  --tickets-color: #7a4a60;
  --sans: "Sazanami Gothic", "MS Gothic", monospace;
}

* {
  box-sizing: border-box;
}

/* Nada aqui é texto para ler no navegador: nem seleção, nem arrasto de imagem. */
#stage,
#stage * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#stage img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* O palco antigo era a página inteira; agora é uma cena do carrossel. */
.event--slab {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}

/* A aba do topo: barra branca fina, com as estrelas de cada lado. */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: grid;
  place-items: center;
  height: 32px;
  background: var(--paper);
  border-bottom: 1px solid #1a1a1a;
  color: #1a1a1a;
}

.topbar__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .18em;
  line-height: 1;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .18s ease;
}

.topbar__tab:hover { opacity: .55; }
.topbar__tab:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 3px; }

.topbar__ornament { letter-spacing: .08em; }

@media (max-width: 600px) {
  .topbar__tab { gap: .45rem; font-size: 10px; }
}

body {
  font-family: var(--sans);
}

/* Camada 1: fundo do palco. */
#stage {
  position: absolute;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--paper);
  background-image: url("/bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* O aparelho e o que está embaixo dele, empilhados no meio da tela. */
.stage__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vh, 32px);
  padding: 3vh 0;
}

/* Camada 2: uma placa de sabão pousada sobre a mesa, com sombra embaixo. */
.slab {
  position: relative;
  flex: none;
  /* Sempre a mesma proporção da tela cheia; quando falta largura, a placa
     encolhe inteira em vez de espremer. Tudo aqui dentro mede em cqw/cqh,
     que seguem a placa, não a janela. */
  --slab-aspect: 1.875;
  --slab-w: min(76vw, 135vh, 1800px);
  width: var(--slab-w);
  height: calc(var(--slab-w) / var(--slab-aspect));
  container-type: size;
  border-radius: calc(var(--slab-w) * 0.0132);
  border: 1px solid rgba(255, 255, 255, .7);
  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      var(--slab) 48%,
      #dfe3e1 100%
    );
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .86),
    inset 0 -3px 4px rgba(80, 88, 96, .18),
    inset -1px 0 2px rgba(80, 88, 96, .1),
    0 3px 0 rgba(115, 122, 128, .28),
    0 16px 24px -8px rgba(35, 42, 49, .3),
    0 5px 8px rgba(35, 42, 49, .14);
}

/* Ondulação do plástico: um relevo suave, gerado por filtro SVG, que dá a
   sensação de superfície levemente enrugada em vez de plástico chapado. */
.slab__wrinkle {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='400'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.010' numOctaves='3' seed='7'/%3E%3CfeDiffuseLighting lighting-color='%23fff' surfaceScale='4'%3E%3CfeDistantLight azimuth='135' elevation='58'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  mix-blend-mode: soft-light;
  opacity: .28;
}

/* Reflexo: o brilho de janela atravessando o plástico. */
.slab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, .16) 0%,
      transparent 38%
    ),
    linear-gradient(
      0deg,
      rgba(74, 80, 88, .025) 0,
      rgba(74, 80, 88, 0) 24%
    );
}

/* A base da placa: a faixa que dobra para baixo antes de encontrar a mesa. */
.slab::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 0;
  height: 0.68cqw;
  border-radius: 0 0 1.32cqw 1.32cqw;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(74, 80, 88, .02) 0,
    rgba(74, 80, 88, .09) 52%,
    rgba(74, 80, 88, .17) 100%
  );
}

/* Dentro do aparelho: a coluna de teclas à esquerda, a tela à direita. */
.slab__layout {
  position: absolute;
  inset: 2.78cqh 1.1cqw;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.69cqw;
}

/* Seis quadrados cavados na lateral esquerda: recesso, não relevo. */
.slab__slots {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 1.8cqh;
}

.slot {
  display: block;
  height: 100%;
  width: auto;
  justify-self: start;
  min-height: 0;
  aspect-ratio: 1;
  position: relative;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: pointer;
  border-radius: 24%;
  border: 0.25cqw solid #e3b5d2;
  background-color: var(--button);
  background-image: url("/btn_texture.webp");
  background-size: cover;
  background-position: center;
  box-shadow:
    inset 0 0.22cqw 0.48cqw -0.08cqw rgba(58, 64, 74, .24),
    inset 0 -0.16cqw 0.32cqw -0.06cqw rgba(255, 255, 255, .92),
    inset 0.12cqw 0 0.2cqw -0.08cqw rgba(58, 64, 74, .12),
    inset -0.12cqw 0 0.2cqw -0.08cqw rgba(255, 255, 255, .72);
  transition: box-shadow .18s ease, transform .18s ease;
}

/* O retrato fica rebaixado dentro da tecla, com o plástico aparecendo em
   volta e a sombra do buraco caindo sobre ele. */
.slot img {
  position: absolute;
  top: 0.1cqw;
  left: 0.1cqw;
  /* Em elemento substituído, width auto usa o tamanho natural e o retrato
     estoura e é cortado; o tamanho tem que ser explícito. */
  width: calc(100% - 0.2cqw);
  height: calc(100% - 0.2cqw);
  object-fit: cover;
  border-radius: 0.42cqw;
  /* Um leve zoom come a margem branca do retrato e encosta o rosto na tecla. */
  transform: scale(1.1);
}

.slot::after {
  content: "";
  position: absolute;
  inset: 0.1cqw;
  z-index: 2;
  pointer-events: none;
  border-radius: 0.42cqw;
  box-shadow:
    /* a luz do alto morre na parede do buraco */
    inset 0 0.21cqw 0.38cqw -0.07cqw rgba(58, 64, 74, .34),
    /* e a parede de baixo devolve */
    inset 0 -0.14cqw 0.18cqw -0.07cqw rgba(255, 255, 255, .55);
}

.slot__num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 0.75cqw;
  letter-spacing: .06em;
  color: #9aa3ad;
}

.slot:has(img) .slot__num { display: none; }

/* Escolhido: a tecla afunda mais um pouco. */
.slot[aria-selected="true"] {
  background-color: var(--button);
  background-image: url("/btn_texture.webp");
  background-size: cover;
  box-shadow:
    inset 0 0.34cqw 0.56cqw -0.1cqw rgba(52, 58, 68, .36),
    inset 0 -0.14cqw 0.28cqw -1px rgba(255, 255, 255, .8),
    inset 0 0 0 1px rgba(52, 58, 68, .18);
}

.slot[aria-selected="true"]::after {
  box-shadow:
    inset 0 0.3cqw 0.4cqw -0.05cqw rgba(52, 58, 68, .38),
    inset 0 -0.14cqw 0.18cqw -0.07cqw rgba(255, 255, 255, .55),
    0 0 0 1px rgba(52, 58, 68, .16);
}

.slot:focus-visible {
  outline: 0.14cqw solid #fff;
  outline-offset: 0.14cqw;
}

/* A tecla que o mecanismo acabou de pisar no caminho. */
.slot.is-walk {
  transform: translateY(1px);
  box-shadow:
    inset 0 0.42cqw 0.58cqw -0.14cqw rgba(52, 58, 68, .4),
    inset 0 -0.14cqw 0.24cqw -1px rgba(255, 255, 255, .78),
    inset 0 0 0 1px rgba(52, 58, 68, .16),
    0 1px 0 rgba(255, 255, 255, .82);
}

/* O vidro da tela: apagado, esperando o conteúdo. */
.slab__screen {
  border-radius: 0.82cqw;
  /* A mesma bordinha rosa das teclas, contornando a área do personagem. */
  border: 0.25cqw solid #e3b5d2;
  background-color: #fc86ab;
  background-image: url("/bg_box.png");
  background-size: cover;
  background-position: center;
  box-shadow:
    inset 0.28cqw 0.28cqw 0.62cqw rgba(62, 70, 78, .2),
    inset 0 0 0 1px rgba(52, 58, 68, .12);
  position: relative;
  overflow: hidden;
}

/* Um reflexo de vidro atravessando o canto. */
.slab__screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* O conteúdo e a cortina que passa na frente quando troca de DJ. */
.slab__content {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  /* O visor é rosa até embaixo: quando o rolo resiste na ponta não aparece
     o cinza do vidro atrás dele. */
  background: transparent;
  /* O arrasto vertical é do rolo, não do navegador. */
  touch-action: none;
}

/* O rolo: as seis fichas empilhadas, uma por altura do visor. */
.slab__reel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* A luz do ambiente: fixa no visor, não rola com as fichas. Só o pé da tela
   escurece um pouco; de cima não vem luz nenhuma. */
.slab__light {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background: none;
}

/* --------------------------------------------------------------------------
   A ficha do DJ dentro do visor
   -------------------------------------------------------------------------- */

.dj {
  position: relative;
  flex: 0 0 100%;
  /* Sem isto o mínimo automático deixa a ficha mais alta que o visor quando o
     sprite é comprido, e as fichas passam a invadir a de cima. */
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 0.96cqw;
  padding: 0.96cqw;
  /* Cor chapada: a luz é uma camada fixa por cima, não um degradê por ficha,
     senão cada ficha recomeça o brilho e a emenda aparece na rolagem. */
  background: transparent;
}

.dj__portrait {
  position: relative;
  /* O sprite é recortado no PNG: a base dele encosta na linha de baixo do
     visor, sem a moldura de vidro que existia antes. */
  margin: 0 0 -0.96cqw;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0;
  background: none;
}

.dj__portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  filter: drop-shadow(0 4px 6px rgba(70, 50, 70, .34));
  /* Cada sprite tem uma proporção; a escala acerta a altura aparente entre
     eles sem mexer no desenho. */
  transform: scale(var(--dj-scale, 1));
  transform-origin: 50% 100%;
}

.dj__fallback {
  font-family: var(--sans);
  font-size: 3.02cqw;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .6);
}

.dj__portrait img + .dj__fallback { display: none; }

.dj__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0.41cqw 0.27cqw 0.27cqw 0;
}

.dj__jp {
  margin: 0;
  font-size: 6cqw;
  line-height: 1.05;
  letter-spacing: .01em;
  color: #fff;
  text-shadow:
    0 0.14cqw 0 rgba(176, 92, 130, .55),
    0 0 1.23cqw rgba(255, 255, 255, .45);
}

.dj__romaji {
  margin: 0.69cqh 0 0;
  font-size: 2.2cqw;
  font-style: italic;
  letter-spacing: .04em;
  color: #3f5f9e;
}

.dj__bio {
  margin: 1.94cqh 0 0;
  font-size: 1cqw;
  line-height: 1.75;
  color: #6b4257;
}

.dj__bio.jp { color: #7a4a60; }

/* Os três samples, no canto de baixo. */
.dj__clips {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.55cqw;
}

.clip {
  font-family: var(--sans);
  font-size: 1.05cqw;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #fff;
  padding: .7em 1.35em;
  border: 0.16cqw solid rgba(255, 255, 255, .95);
  border-radius: 68.52cqw;
  cursor: pointer;
  background-color: var(--button);
  background-image: url("/btn_texture.webp");
  background-size: cover;
  background-position: center;
  box-shadow:
    0 0.14cqw 0 rgba(32, 104, 143, .45),
    0 0.41cqw 0.96cqw rgba(32, 104, 143, .22),
    inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .1s ease, box-shadow .18s ease, background .18s ease;
}

.clip:hover { filter: brightness(1.08); }

.clip:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(32, 104, 143, .5); }

.clip.is-playing {
  color: #fff;
  background-color: var(--button);
  background-image: url("/btn_texture.webp");
  background-size: cover;
  box-shadow: 0 1px 0 rgba(88, 70, 155, .5), inset 0 0.14cqw 0.34cqw rgba(255, 255, 255, .35);
}

.clip:disabled {
  opacity: .5;
  cursor: not-allowed;
  filter: saturate(.7);
}

.clip:disabled:hover {
  filter: none;
}

.clip:focus-visible {
  outline: 0.14cqw solid #fff;
  outline-offset: 0.21cqw;
}

/* Grão do material: tira o aspecto de gradiente de vetor. */
.slab__grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: url("/grain.png");
  background-size: 12.35cqw 12.35cqw;
  background-repeat: repeat;
  opacity: .5;
  mix-blend-mode: overlay;
}

/* Camada 3: o convite, em baixo do aparelho. */
.tickets {
  position: relative;
  margin: 0;
  display: inline-block;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 62px);
  line-height: 1;
  letter-spacing: .04em;
  cursor: pointer;
  filter:
    drop-shadow(0 2px 2px rgba(38, 42, 48, .32))
    drop-shadow(0 10px 18px rgba(38, 42, 48, .22));
}

.tickets:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 8px;
}

/* O contorno é uma cópia branca mais grossa atrás do texto. */
.tickets::before,
.name::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  z-index: 0;
  color: #fff;
  -webkit-text-stroke: clamp(5px, .38vw, 9px) #fff;
}

.tickets span {
  position: relative;
  z-index: 1;
  color: var(--tickets-color);
}

.name span {
  position: relative;
  z-index: 1;
  color: var(--name-color);
}

/* O nome em cima do aparelho: mesmo tratamento do convite. */
.name {
  position: relative;
  margin: 0;
  display: inline-block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 62px);
  line-height: 1;
  letter-spacing: .04em;
  filter:
    drop-shadow(0 2px 2px rgba(38, 42, 48, .32))
    drop-shadow(0 10px 18px rgba(38, 42, 48, .22));
}

/* Mobile: reflow the appliance instead of shrinking its widescreen face. */
@media (max-width: 600px) {
  .stage__inner {
    justify-content: flex-start;
    gap: 10px;
    padding: 40px 0 12px;
  }

  .slab {
    --slab-w: min(calc(100vw - 16px), 480px);
    width: var(--slab-w);
    height: min(68dvh, 500px);
    border-radius: 10px;
  }

  .slab__layout {
    inset: 10px 1.5cqw 12px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr);
    gap: 8px;
  }

  .slab__slots {
    grid-template-columns: repeat(6, minmax(44px, 1fr));
    grid-template-rows: 44px;
    justify-content: center;
    gap: 4px;
  }

  .slot {
    width: 100%;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-width: 1px;
    border-radius: 8px;
  }

  .slot img {
    top: 1px;
    left: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    border-radius: 6px;
  }

  .slot::after {
    inset: 1px;
    border-radius: 6px;
  }

  .slot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  .slab__screen {
    min-height: 0;
    border: 1px solid #e3b5d2;
    border-radius: 10px;
  }

  .slab__content {
    z-index: 4;
  }

  .dj {
    display: block;
    padding: 0;
  }

  .dj__portrait {
    position: absolute;
    inset: 0 0 8px;
    z-index: 0;
    min-height: 0;
    margin: 0;
  }

  .dj__portrait img {
    object-fit: contain;
    object-position: 50% 100%;
    transform: scale(calc(var(--dj-scale, 1) + 0.06));
    transform-origin: 50% 100%;
  }

  .dj__info {
    position: absolute;
    inset: auto 8px 8px;
    z-index: 1;
    height: 46%;
    max-height: calc(100% - 80px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    justify-content: flex-start;
    overflow: hidden;
    color: #1a1a1a;
    background: rgba(244, 245, 244, .72);
    -webkit-backdrop-filter: blur(8px) saturate(1.08);
    backdrop-filter: blur(8px) saturate(1.08);
    border: 1px solid #e3b5d2;
    border-radius: 10px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .78),
      0 8px 18px rgba(26, 28, 32, .22);
  }

  .dj__jp {
    font-size: clamp(20px, 5.7vw, 24px);
    line-height: 1.05;
    text-wrap: balance;
    color: #1a1a1a;
    text-shadow: none;
  }

  .dj__romaji {
    margin: 2px 0 0;
    font-size: 13px;
  }

  .dj__bio-copy {
    flex: 1 1 0;
    min-height: 0;
    padding-right: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .dj__bio {
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 1.2;
  }

  .dj__clips {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
  }

  .clip {
    width: 100%;
    min-width: 44px;
    min-height: 44px;
    padding: 4px 3px;
    border-width: 1px;
    font-size: 12px;
    letter-spacing: .025em;
  }

  .tickets {
    font-size: clamp(34px, 9vw, 46px);
  }

  .name {
    font-size: clamp(28px, 7vw, 36px);
  }
}
