/* Ad Reward Mini App – Premium Black + High Pink Glass Design */

:root {
  --bg: #000000;
  --bg-card: rgba(18, 18, 22, 0.85);
  --pink: #ff1493;
  --pink-soft: rgba(255, 20, 147, 0.12);
  --pink-border: rgba(255, 20, 147, 0.55);
  --pink-glow: rgba(255, 20, 147, 0.35);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.55);
  --radius: 14px;
  --max-w: 520px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  min-height: 100dvh;
}

#app {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 16px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---- Telegram-only gate ---- */
.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 80vh;
  padding: 24px;
  gap: 16px;
}

.gate h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--pink);
}

.gate p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 280px;
}

/* ---- Buttons (glass) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 20, 147, 0.08);
  border: 1px solid var(--pink-border);
  color: var(--pink);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 0 12px rgba(255, 20, 147, 0.12);
  text-decoration: none;
  width: 100%;
  max-width: 320px;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
  background: rgba(255, 20, 147, 0.18);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.9rem;
  max-width: 160px;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  box-shadow: none;
}

/* ---- Card ---- */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 20, 147, 0.18);
  border-radius: 18px;
  padding: 28px 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  text-align: center;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.file-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.file-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.progress-wrap {
  margin: 20px 0 8px;
}

.progress-text {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), #ff69b4);
  border-radius: 99px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--pink-glow);
}

.reward-label {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.reward-value {
  color: var(--pink);
  font-weight: 600;
  font-size: 1.05rem;
}

.actions {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ---- Loader ---- */
.loader {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 20, 147, 0.2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal {
  background: #0d0d10;
  border: 1px solid var(--pink-border);
  border-radius: 18px;
  padding: 28px 22px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 20, 147, 0.2);
}

.modal h2 {
  color: var(--pink);
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.token-box {
  background: rgba(255, 20, 147, 0.08);
  border: 1px dashed var(--pink-border);
  border-radius: 12px;
  padding: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: #fff;
  word-break: break-all;
  margin-bottom: 20px;
  user-select: text;
  -webkit-user-select: text;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ---- Error / Info states ---- */
.state-message {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.state-message h2 {
  color: var(--pink);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

/* Prevent context menu / long-press link preview on sensitive buttons */
.btn, .btn * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
