/* ========================================================
   2. BASE RESETS & GLOBAL LAYOUT
   ======================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent !important;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent !important;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  color: var(--ink);
  background-color: var(--paper-bg);
  background-image: url("../assets/rough-paper.png");
  background-position: center top;
  background-repeat: repeat-y;
  background-size: 100% auto;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
}

body:not(.invite-open) {
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
}

/* Safari / Zalo / Messenger WebView: font-size < 16px → auto-zoom khi focus → scroll ngang */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="password"],
input:not([type]),
textarea,
select {
  font-size: 16px !important;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  outline: none !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  outline: none !important;
}

input, textarea {
  -webkit-user-select: auto !important;
  user-select: auto !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Khi đang focus input: khóa cứng không cho kéo ngang (WebView Zalo/Messenger) */
html.input-focused,
html.input-focused body {
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

/* App Container */
.app-container {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 0 14px 60px;
  position: relative;
}

.reveal-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin-bottom: 40px;
}

.reveal-section.visible {
  opacity: 1;
  transform: none;
}
