@font-face {
  font-family: 'Brown Holmes';
  src: url('../assets/fonts/brown-holmes.otf') format('opentype');
  font-display: block;
}

:root {
  --ink: #10100f;
  --paper: #ede6c4;
  --cream: #e3d8b6;
  --sand: #eac78a;
  --red: #b63b19;
  --green: #65805d;
  --deep: #2d4e40;
  --brown: #34120f;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  font-family: 'Brown Holmes', system-ui, sans-serif;
  /* a fonte da identidade é sempre em minúsculas */
  text-transform: lowercase;
}

button, a { font: inherit; text-transform: lowercase; }

/* em tela larga (computador) a viagem vira uma coluna em pé, como no celular */
#gl {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw, 52vh);
  width: min(100vw, 52dvh);
  height: 100vh;
  height: 100dvh;
  display: block;
}

/* ---------- entrada ---------- */
#intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  background: var(--ink);
  transition: background-color 1.6s ease 0.4s;
}
#intro.leaving { background-color: rgba(16, 16, 15, 0); pointer-events: none; }
#intro.leaving .kicker, #intro.leaving .faltam, #intro.leaving .go, #intro.leaving .aviso {
  opacity: 0; transform: translateY(30px) scaleY(1.4); filter: blur(6px);
  transition: all 0.9s ease-in;
}

.kicker { margin: 0; font-size: 15px; letter-spacing: 0.06em; color: var(--sand); }

.qr { width: min(70vw, 42vh, 360px); aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; overflow: visible; display: block; }
.qr .eye, .qr .mod, .qr .papel {
  transform-box: fill-box;
  transform-origin: center;
}
.qr .eye { transition: transform 1s cubic-bezier(.2, 1.35, .4, 1), opacity .25s; opacity: 0; }
.qr .eye-tl { transform: translate(-260%, -320%) rotate(-260deg) scale(1.6); }
.qr .eye-tr { transform: translate(300%, -260%) rotate(280deg) scale(1.6); }
.qr .eye.in { transform: none; opacity: 1; }
.qr.pulse svg { animation: qrpulse 0.6s ease-out; }
@keyframes qrpulse { 40% { transform: scale(1.05); } }

.faltam {
  margin: 0;
  font-size: clamp(19px, 5.6vw, 28px);
  line-height: 1.05;
  text-align: center;
  max-width: 330px;
  min-height: 2.2em;
}

.btn {
  border: 0;
  cursor: pointer;
  padding: 14px 24px 12px;
  font-size: 21px;
  line-height: 1;
  color: var(--paper);
  background: var(--red);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--brown);
  text-decoration: none;
  display: inline-block;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brown); }
.btn.alt { background: var(--green); box-shadow: 0 4px 0 var(--deep); }
.btn.dark { background: var(--ink); color: var(--paper); box-shadow: 0 4px 0 #000; }

.go {
  font-size: 25px;
  padding: 16px 30px 14px;
  transform: rotate(-2deg);
  transition: opacity .6s, transform .6s;
}
.go:disabled { opacity: 0; transform: rotate(-2deg) scale(.8); pointer-events: none; }
.go:not(:disabled) { animation: gobreath 2.4s ease-in-out infinite; }
@keyframes gobreath { 50% { transform: rotate(1.5deg) scale(1.05); } }

.aviso {
  margin: 4px 0 0;
  max-width: 300px;
  text-align: center;
  font: 11px/1.35 system-ui, sans-serif;
  color: #8d877a;
}

/* ---------- durante a viagem ---------- */
.hint {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(26px + var(--safe-b));
  margin: 0;
  text-align: center;
  font-size: 21px;
  color: var(--paper);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
  pointer-events: none;
  z-index: 5;
  animation: hintpulse 2.2s ease-in-out infinite;
}
@keyframes hintpulse { 50% { opacity: .45; transform: scale(1.04); } }

.mute {
  position: fixed;
  top: calc(12px + var(--safe-t));
  right: 12px;
  z-index: 20;
  padding: 8px 13px 6px;
  font-size: 15px;
  color: var(--cream);
  background: rgba(16, 16, 15, .55);
  border: 1px solid rgba(227, 216, 182, .35);
  border-radius: 999px;
  cursor: pointer;
}

#frags { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.frag {
  position: absolute;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 86vw;
  text-align: center;
  font-size: clamp(17px, 5vw, 24px);
  line-height: 1.05;
  color: var(--paper);
  text-shadow: 0 0 14px rgba(0, 0, 0, .9), 0 2px 2px rgba(0, 0, 0, .6);
  animation: frag 4.6s ease-in-out forwards;
}
@keyframes frag {
  0%   { opacity: 0; filter: blur(14px); transform: translate(-50%, -50%) scale(1.35); }
  16%  { opacity: 1; filter: blur(0); transform: translate(-50%, -50%) scale(1); }
  68%  { opacity: 1; filter: blur(0); transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; filter: blur(7px); transform: translate(-50%, -10%) scale(1, 1.9); }
}

/* ---------- recompensa ---------- */
#reward {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-t)) 14px calc(16px + var(--safe-b));
  pointer-events: none;
}
.card {
  pointer-events: auto;
  width: min(92vw, 400px);
  max-height: 100%;
  overflow-y: auto;
  touch-action: pan-y;
  padding: 38px 26px 28px;
  color: var(--ink);
  text-align: center;
  background: url('../assets/svg/papel.svg') center / 100% 100% no-repeat;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .6));
}
.card.melting { filter: url(#melt) drop-shadow(0 18px 40px rgba(0, 0, 0, .6)); }
.card p { margin: 0; }
.card .k { font-size: 17px; color: var(--green); }
.card .cupom-label { margin-top: 14px; font-size: 16px; }
.card .cupom {
  font-size: clamp(46px, 14vw, 64px);
  line-height: .95;
  color: var(--red);
  margin: 2px 0 16px;
  transform: rotate(-2deg);
}
.card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.card .sub { margin: 24px 0 8px; font-size: 16px; color: var(--green); }
.playlist iframe { width: 100%; height: 152px; border: 0; border-radius: 12px; display: block; }
.playlist .vazio {
  border: 2px dashed rgba(16, 16, 15, .28);
  border-radius: 12px;
  padding: 16px 12px 12px;
  font-size: 17px;
  color: rgba(16, 16, 15, .6);
}
.playlist .abrir { display: inline-block; margin-top: 8px; font-size: 15px; color: var(--ink); }
#saveTrip { margin-top: 20px; }
.link {
  display: block;
  margin: 16px auto 0;
  padding: 6px;
  border: 0;
  background: none;
  font-size: 17px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link.light { color: var(--cream); margin: 0; }

.pill {
  position: fixed;
  right: 14px;
  bottom: calc(16px + var(--safe-b));
  z-index: 25;
  padding: 11px 18px 9px;
  border: 0;
  border-radius: 999px;
  font-size: 19px;
  color: var(--paper);
  background: var(--red);
  box-shadow: 0 4px 0 var(--brown), 0 6px 24px rgba(0, 0, 0, .5);
  cursor: pointer;
}

#shot {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 16, 15, .94);
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
}
.shot-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.shot-inner img {
  max-width: 82vw;
  max-height: 66vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .7);
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
  touch-action: auto;
}
.shot-inner p { margin: 0; font-size: 17px; }
.shot-inner .row { display: flex; gap: 14px; align-items: center; }

#debug {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 50;
  font: 11px/1.4 ui-monospace, monospace;
  text-transform: none;
  color: #0f0;
  background: rgba(0, 0, 0, .6);
  padding: 6px 8px;
  pointer-events: none;
  white-space: pre;
}
