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

.unmute-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #1e3a5f 0%, #28508a 45%, #3a6bb5 100%);
  background-repeat: no-repeat;
  background-size: cover;
  color: #fff;
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 1.25rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.flash-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
}

.flash-overlay.flash-bang {
  animation: flash-bang 1s ease-out forwards;
}

@keyframes flash-bang {
  0% { opacity: 0; }
  5% { opacity: 1; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(160deg, #1e3a5f 0%, #28508a 45%, #3a6bb5 100%);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  transition: background 0.4s ease-out;
}

body.app-window-open {
  background: #6b2d45;
  background-repeat: no-repeat;
  background-size: cover;
}

body.answered {
  overflow: hidden;
}

body.app-window-open .main-content {
  opacity: 0;
  pointer-events: none;
}

body {
  display: flex;
  flex-direction: column;
}

.body-loading .main-content {
  opacity: 0;
  pointer-events: none;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  opacity: 1;
  transition: opacity 0.3s ease-out;
  overflow: hidden;
  min-height: 0;
}

.stage-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}

.stage-content {
  position: absolute;
  bottom: 25vh;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.btn-atender {
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 1px #1e4d1e;
  padding: 0.85rem 2.5rem;
  border: 1px solid #1e4d1e;
  border-radius: 4px;
  background: linear-gradient(180deg, #5cb85c 0%, #4a9c3e 4%, #3a7e34 50%, #2d6b27 100%);
  box-shadow:
    inset 0 1px 0 #8ed08e,
    0 1px 2px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
  position: relative;
  z-index: 10;
}

body.btn-ready .btn-atender {
  opacity: 1;
  pointer-events: auto;
}

body.answered .btn-atender {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.btn-atender:hover {
  background: linear-gradient(180deg, #6bc46b 0%, #55a84e 4%, #43943a 50%, #357a2d 100%);
  box-shadow:
    inset 0 1px 0 #9ee09e,
    0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-atender:active {
  background: linear-gradient(180deg, #3a7e34 0%, #2d6b27 50%, #246b24 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  transform: translateY(1px);
}

.pokeball-shake {
  animation: pokeball-shake 1.2s ease-in-out infinite;
}

@keyframes pokeball-shake {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: translateX(-4px) rotate(-3deg); }
  20% { transform: translateX(4px) rotate(3deg); }
  30% { transform: translateX(-3px) rotate(-2deg); }
  40% { transform: translateX(3px) rotate(2deg); }
  40.01%, 100% { transform: rotate(0deg); }
}

.center-image {
  display: block;
  width: 90vw;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
  will-change: transform;
  transform: scale(1);
  transform-origin: 32% 8%;
}

.center-image.zoom-in {
  position: fixed;
  left: 50%;
  bottom: 25vh;
  transform: translateX(-50%) scale(1);
  z-index: 9998;
  animation: zoom-in 5s ease-out forwards;
}

@keyframes zoom-in {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(3.2); }
}

.center-image.vanish {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
}

/* Stickers around the window (shown when Revelio is clicked) */
.window-stickers--hidden {
  display: none !important;
}

.window-stickers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9995;
}

.window-stickers-rany {
  z-index: 10001;
  pointer-events: none;
}

.window-stickers-rany--revelio-hidden {
  display: none !important;
}

.window-stickers-rany--bottom-half {
  top: 50%;
  bottom: 0;
  left: 0;
  right: 0;
}

.revelio-rany-big--hidden {
  display: none !important;
}

.revelio-rany-big {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 150px;
  height: auto;
  z-index: 10002;
  pointer-events: none;
}

.revelio-rany-big-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 2px #6b2d45) drop-shadow(0 0 4px #6b2d45) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.revelio-btn-overlay--hidden {
  display: none !important;
}

.revelio-btn-overlay {
  position: fixed;
  z-index: 99999;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.6rem 1.2rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.75rem;
  color: #2d1a24;
  background: linear-gradient(180deg, #f8e8ee 0%, #e8c4d4 100%);
  border: 2px solid #c49aa8;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(45, 26, 36, 0.15);
  text-align: center;
  pointer-events: auto;
}

.revelio-btn-overlay .revelio-btn-overlay-sub {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.5rem;
  font-weight: 500;
  opacity: 0.9;
}

.revelio-btn-overlay--back .revelio-btn-overlay-sub {
  display: none;
}

.window-sticker-wrap {
  position: absolute;
  transform-origin: center center;
  pointer-events: none;
}

.window-sticker-wrap .window-sticker {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.window-sticker-wrap--rany .window-sticker {
  filter:
    drop-shadow(0 -2px 0 #6b2d45) drop-shadow(0 2px 0 #6b2d45)
    drop-shadow(-2px 0 0 #6b2d45) drop-shadow(2px 0 0 #6b2d45)
    drop-shadow(-2px -2px 0 #6b2d45) drop-shadow(-2px 2px 0 #6b2d45)
    drop-shadow(2px -2px 0 #6b2d45) drop-shadow(2px 2px 0 #6b2d45)
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.28)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.window-sticker--shake-now {
  animation: sticker-shake-once 1.3s ease-in-out;
  transform-origin: center center;
}

@keyframes sticker-shake-once {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  20% { transform: translate(-1px, 0) rotate(-1.5deg) scale(1.3); }
  40% { transform: translate(1px, 0) rotate(1.5deg) scale(1.3); }
  60% { transform: translate(-1px, 0) rotate(-1deg) scale(1.3); }
  80% { transform: translate(1px, 0) rotate(0.5deg) scale(1.3); }
}

/* App window – pop 2000s aesthetic (pink, glossy), almost full screen */
.app-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(76vw, 1000px);
  height: min(80vh, 750px);
  max-width: 76vw;
  max-height: 80vh;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #d96a9a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.8),
    0 4px 12px rgba(217, 106, 154, 0.35);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease-out, visibility 0.35s ease-out;
}

.app-window.app-window--visible {
  opacity: 1;
  visibility: visible;
}

.app-window {
  display: flex;
  flex-direction: column;
}

.app-window-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 8px;
  gap: 8px;
  background: linear-gradient(180deg, #ffb8d4 0%, #f08ab0 50%, #e86a9a 100%);
  border-bottom: 2px solid #d96a9a;
  font-family: "Press Start 2P", monospace;
}

.app-window-title-center {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-window-title-text {
  font-size: 8px;
  color: #2d1a24;
  line-height: 36px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.app-window-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-window-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: linear-gradient(180deg, #fff 0%, #fce4ec 100%);
  color: #2d1a24;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid #d96a9a;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 0 rgba(232, 106, 154, 0.2);
  -webkit-tap-highlight-color: transparent;
}

.app-window-btn--close {
  font-size: 12px;
  line-height: 0.9;
}

.app-window-body {
  flex: 1;
  min-height: 0;
  background: #fff5f9;
  border-top: 1px solid #f5d4e4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px;
  overflow: auto;
}

.app-window-code-form {
  width: 100%;
  max-width: 320px;
}

.app-window-greeting {
  margin: 0 0 16px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  line-height: 1.5;
  color: #2d1a24;
  text-align: center;
}

.app-window-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.app-window-code-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: #2d1a24;
  background: #fff;
  border: 2px solid #d96a9a;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

.app-window-code-input::placeholder {
  color: #b84a6a;
  opacity: 0.8;
}

.app-window-send-btn {
  flex: 0 0 auto;
  width: 48px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  color: #2d1a24;
  background: linear-gradient(180deg, #ffb8d4 0%, #f08ab0 100%);
  border: 2px solid #d96a9a;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 0 rgba(232, 106, 154, 0.2);
  -webkit-tap-highlight-color: transparent;
}

.app-window-send-btn:hover {
  background: linear-gradient(180deg, #ffc4dc 0%, #f098b8 100%);
}

.app-window-code-message {
  margin: 12px 0 0;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  line-height: 1.5;
  color: #2d1a24;
  text-align: center;
  min-height: 1.5em;
}

.app-window-code-form--hidden {
  display: none !important;
}

.app-window-invitation--hidden {
  display: none !important;
}

.app-window-invitation {
  width: 100%;
  max-width: 420px;
  padding: 6px 10px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.app-window-revelio-btn {
  position: relative;
  z-index: 10010;
  margin-top: 1.25rem;
  margin-left: auto;
  padding: 0.6rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  align-self: flex-end;
  font-family: "Press Start 2P", monospace;
  font-size: 0.75rem;
  color: #2d1a24;
  background: linear-gradient(180deg, #f8e8ee 0%, #e8c4d4 100%);
  border: 2px solid #c49aa8;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(45, 26, 36, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-window-revelio-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(45, 26, 36, 0.2);
}

.app-window-revelio-btn:active {
  transform: translateY(0);
}

.app-window-revelio-btn-label {
  display: block;
  font-size: inherit;
}

.app-window-revelio-btn-sub {
  display: block;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.5rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.3;
}

.app-window-revelio-btn--back {
  order: 1;
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  left: 0;
  top: 0;
}

.app-window-revelio-btn--back .app-window-revelio-btn-sub {
  display: none;
}

.app-window-invitation--revelio-hidden {
  display: none !important;
}

.dress-code-view--hidden {
  display: none !important;
}

.dress-code-view {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  order: 0;
}

.dress-code-view-intro {
  margin: 0 0 0.75rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  line-height: 1.5;
  color: #2d1a24;
  text-align: center;
  max-width: 360px;
}

.dress-code-view-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.revista-view--hidden {
  display: none !important;
}

.revista-view {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0;
  order: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.revista-view-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.revista-view-text {
  margin: 1rem 0 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  line-height: 1.6;
  color: #2d1a24;
  text-align: center;
  max-width: 360px;
}

.revista-view-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.75rem;
  color: #2d1a24;
  background: linear-gradient(180deg, #f8e8ee 0%, #e8c4d4 100%);
  border: 2px solid #c49aa8;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(45, 26, 36, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.revista-view-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(45, 26, 36, 0.2);
}

.revista-view-btn:active {
  transform: translateY(0);
}

.eu-vou-view--hidden {
  display: none !important;
}

.eu-vou-view {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0;
  order: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.eu-vou-view-content {
  width: 100%;
  max-width: 360px;
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #2d1a24;
  text-align: center;
}

.eu-vou-view .app-window-invitation-info {
  border-top: none;
  padding-top: 0;
  font-size: 0.85rem;
}

.eu-vou-view-info {
  margin-bottom: 0.75rem;
}

.eu-vou-view-content .eu-vou-view-line {
  margin: 0 0 0.5em;
  font-size: 1rem;
}

.eu-vou-view-content .eu-vou-view-line:last-child {
  margin-bottom: 0;
}

.eu-vou-view-rany {
  display: block;
  width: 260px;
  max-width: 90%;
  height: auto;
  margin: 1.25rem auto 0;
  object-fit: contain;
}

.app-window-invitation-title {
  display: none; /* Title shown in window title bar only */
}

.app-window-invitation-text,
.app-window-invitation-info {
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.65;
  color: #2d1a24;
  text-align: left;
  margin: 0 auto;
  max-width: 360px;
  padding: 2px 4px;
  display: block;
  width: 100%;
  min-width: 0;
}

.app-window-invitation-text {
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.app-window-invitation-info {
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.01em;
  margin-top: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(45, 26, 36, 0.2);
  white-space: pre-wrap;
}


.app-window-invitation-text .app-window-invitation-paragraph {
  margin: 0 0 0.75em;
}

.app-window-invitation-text .app-window-invitation-paragraph:last-child {
  margin-bottom: 0;
}

.app-window-invitation-info .app-window-invitation-line {
  margin: 0 0 0.4em;
  display: block;
  min-height: 1.2em;
}

.app-window-invitation-info .app-window-invitation-line:last-child {
  margin-bottom: 0;
}

.app-window-invitation-info .app-window-invitation-label {
  font-weight: 600;
}
