/* ========================================
   RewardHub — User Experience System V2
   ======================================== */

:root {
  --bg: #f4f6f9;
  --background: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-dark: #0f766e;
  --primary-soft: #ccfbf1;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --success: #059669;
  --warning: #d97706;
  --danger: #e11d48;
  --info: #0284c7;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.1);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius: 16px;
  --nav-h: 72px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --max: 1360px;
  --content-width: 1360px;
  --content-wide: 1760px;
  --space: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
}

.muted {
  color: var(--muted);
}

.container {
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
}

.container--wide {
  width: min(100% - 2rem, var(--content-wide));
  margin-inline: auto;
}

/* ---- Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.logo__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: var(--border-soft);
  color: var(--text);
}

.nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav-points {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: #0f172a;
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.nav-points span {
  color: #5eead4;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.2s;
}

.nav {
  min-width: 0;
}

.nav-links {
  min-width: 0;
}

.nav-user__name {
  white-space: nowrap;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.28);
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn--ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--border-soft);
}

.btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 10px;
}

.btn--lg {
  padding: 0.9rem 1.6rem;
  font-size: 1.05rem;
}

.btn--block {
  width: 100%;
}

.btn--success {
  background: var(--success);
  color: #fff;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 85% 20%, rgba(13, 148, 136, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(245, 158, 11, 0.1), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  max-width: 14ch;
}

.hero__lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 36ch;
  margin-bottom: 1.75rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__visual {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, #0f766e, #134e4a 40%, #0f172a);
  box-shadow: var(--shadow-lg);
}

.hero__visual-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
  color: #fff;
  background:
    linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.55)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.08'%3E%3Ccircle cx='40' cy='40' r='18'/%3E%3Ccircle cx='40' cy='40' r='28'/%3E%3C/g%3E%3C/svg%3E");
}

.hero__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.hero__play::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 18px solid var(--primary);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 4px;
}

.hero__visual h3 {
  font-size: 1.25rem;
  margin: 0;
}

.hero__visual p {
  margin: 0.35rem 0 0;
  opacity: 0.85;
  font-size: 0.95rem;
}

/* ---- Sections ---- */
.section {
  padding: 3rem 0;
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section__head h2 {
  font-size: 1.6rem;
  margin: 0;
}

.section__head a {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.page-header {
  padding: 2.25rem 0 1.25rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

/* ---- Points card ---- */
.points-card {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  border: none;
}

.points-card:hover {
  transform: translateY(-2px);
}

.points-card__label {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-bottom: 0.25rem;
}

.points-card__value {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.points-card__value span {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.7;
  margin-left: 0.35rem;
}

/* ---- Grid ---- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* ---- Task cards ---- */
.task-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  overflow: hidden;
}

.task-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s;
}

.task-card:hover .task-card__media img {
  transform: scale(1.04);
}

.platform-chip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  backdrop-filter: blur(6px);
  line-height: 1;
}

.platform-chip--youtube { background: rgba(220, 38, 38, 0.92); }
.platform-chip--tiktok { background: rgba(15, 23, 42, 0.92); }
.platform-chip--instagram { background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6); }
.platform-chip--facebook { background: rgba(37, 99, 235, 0.92); }
.platform-chip--website { background: rgba(13, 148, 136, 0.92); }
.platform-chip--vimeo { background: rgba(26, 183, 234, 0.95); }
.platform-chip--dailymotion { background: rgba(0, 114, 227, 0.95); }
.platform-chip__icon {
  display: inline-flex;
  width: 0.9rem;
  height: 0.9rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.platform-chip__icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}
.platform-chip--static {
  position: static;
  backdrop-filter: none;
}
.task-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.task-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.watch-time-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.task-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.85rem 1.05rem 1rem;
}

.task-card__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}

.task-card h3 {
  font-size: 1.02rem;
  line-height: 1.35;
  margin: 0 0 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.task-card h3 a:hover {
  color: var(--primary);
}

.task-card .muted {
  font-size: 0.86rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
  margin: 0;
}

.task-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.task-card--done {
  opacity: 0.88;
}

.type-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.badge--done {
  background: #d1fae5;
  color: #047857;
}

.badge--demo,
.badge--unavailable {
  background: #e2e8f0;
  color: #334155;
}

.points-pill {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.points-pill--cost {
  background: var(--accent-soft);
  color: #b45309;
}

/* ---- How it works ---- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.how-step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.how-step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.how-step__num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.how-step h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.how-step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---- Filters ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: 0.2s;
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---- Watch page ---- */
.watch-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.player-shell {
  background: #0f172a;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
  box-shadow: var(--shadow-md);
}

.player-shell img,
.player-shell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Task detail player stage — layout via data-layout / data-provider (not verificationMode) */
.player-stage {
  position: relative;
  width: 100%;
  min-height: 240px;
  background: #0b1220;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.25s ease, outline 0.25s ease;
}

.player-stage[data-layout="landscape"],
.player-stage--landscape {
  aspect-ratio: 16 / 9;
}

.player-stage[data-layout="intrinsic"],
.player-stage--intrinsic {
  aspect-ratio: auto;
  min-height: 220px;
}

/* Portrait: hug a centered 9:16 column — no wide 16:9 theater crush */
.player-stage[data-layout="portrait"],
.player-stage--portrait {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  aspect-ratio: auto;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(51, 65, 85, 0.28), transparent 55%),
    #0b1220;
  padding: 0.35rem 0;
}

.watch-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 0.2rem;
}

.verify-hint {
  margin: 0.15rem 0 0.35rem;
}

.watch-status-hint {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.media-debug {
  position: relative;
  z-index: auto;
  margin: 0.85rem 0 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.media-debug ul {
  margin: 0.35rem 0 0.55rem;
  padding-left: 1.1rem;
}

.media-debug strong {
  display: block;
  margin-bottom: 0.45rem;
  color: #93c5fd;
}

.demo-server-banner {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 0.92rem;
}

.demo-server-banner a {
  font-weight: 700;
  color: #c2410c;
}

.player-stage__frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.player-stage[data-layout="portrait"] .player-stage__frame,
.player-stage--portrait .player-stage__frame {
  width: min(100%, 420px);
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: min(70vh, 720px);
  margin: 0 auto;
  align-self: flex-start;
  position: relative;
}

/* Base iframe/video — no forced 100% height for all platforms */
.player-stage__frame iframe,
.player-stage__frame video {
  max-width: 100%;
  border: 0;
  display: block;
  background: #000;
}

/* ---- Landscape providers (YouTube / Vimeo / Dailymotion / generic) ---- */
.player-stage[data-provider="youtube"] .player-stage__frame iframe[data-provider="youtube"],
.player-stage[data-provider="youtube"] .player-stage__frame div[data-provider="youtube"],
.player-stage[data-provider="vimeo"] .player-stage__frame iframe[data-provider="vimeo"],
.player-stage[data-provider="dailymotion"] .player-stage__frame iframe[data-provider="dailymotion"],
.player-stage[data-provider="dailymotion"] .player-stage__frame div[data-provider="dailymotion"],
.player-stage[data-provider="generic"] .player-stage__frame iframe[data-provider="generic"],
.player-stage[data-provider="other"] .player-stage__frame iframe[data-provider="generic"] {
  width: 100%;
  height: 100%;
  max-width: 100%;
  border: 0;
  background: #000;
}

/* ---- HTML5 / website intrinsic ---- */
.player-stage[data-provider="html5"] .player-stage__frame video,
.player-stage[data-provider="website"] .player-stage__frame video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  background: #000;
}

/* ---- TikTok portrait: fill 9:16 frame ---- */
.player-stage[data-provider="tiktok"] .player-stage__frame iframe[data-provider="tiktok"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 12px;
  background: #000;
}

/* ---- Instagram portrait: fill frame; do not inherit landscape iframe rules ---- */
.player-stage[data-provider="instagram"] {
  background: #0b1220;
}

.player-stage[data-provider="instagram"] .player-stage__frame {
  overflow: hidden;
  align-items: stretch;
  justify-content: stretch;
}

.player-stage[data-provider="instagram"] .player-stage__frame > .instagram-media,
.player-stage[data-provider="instagram"] .player-stage__frame > blockquote.instagram-media,
.player-stage[data-provider="instagram"] .player-stage__frame > iframe.instagram-media,
.player-stage[data-provider="instagram"] .player-stage__frame iframe[data-provider="instagram"] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 12px;
  background: transparent !important;
  overflow: hidden !important;
}

/* ---- Facebook landscape / intrinsic plugin ---- */
.player-stage[data-provider="facebook"] {
  aspect-ratio: 16 / 9;
}

.player-stage[data-provider="facebook"] .player-stage__frame .fb-embed-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

.player-stage[data-provider="facebook"] .player-stage__frame .fb-embed-wrap iframe[data-provider="facebook"],
.player-stage[data-provider="facebook"] .player-stage__frame iframe[data-provider="facebook"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  border: 0;
  background: #000;
}

.player-stage[data-provider="facebook"] .player-stage__frame .fb-video[data-provider="facebook"] {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.player-loading,
.player-error {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  color: #e2e8f0;
  background: rgba(11, 18, 32, 0.92);
}

.player-loading[hidden],
.player-error[hidden] {
  display: none !important;
}

.player-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.35);
  border-top-color: #5eead4;
  animation: player-spin 0.8s linear infinite;
}

@keyframes player-spin {
  to { transform: rotate(360deg); }
}

.player-error h3 {
  margin: 0;
  color: #fff;
  font-size: 1.1rem;
}

.player-error p {
  margin: 0;
  color: #94a3b8;
  max-width: 28rem;
}

.player-inline-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  width: 100%;
  color: #fecaca;
  background: #111827;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 12px;
}

/* Prefer task-page light tip; hide verbose adapter notes inside stage */
.player-stage .embed-note {
  display: none !important;
}

@media (max-width: 720px) {
  .player-stage[data-layout="portrait"] .player-stage__frame,
  .player-stage--portrait .player-stage__frame {
    width: min(100%, 360px);
    max-height: min(68vh, 640px);
  }
}

.sim-player {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background:
    radial-gradient(circle at 30% 30%, rgba(13, 148, 136, 0.35), transparent 50%),
    linear-gradient(160deg, #0f172a, #134e4a);
  cursor: pointer;
  user-select: none;
}

.sim-player__ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  transition: transform 0.2s, border-color 0.2s;
}

.sim-player:hover .sim-player__ring {
  transform: scale(1.05);
  border-color: #fff;
}

.sim-player__icon {
  width: 0;
  height: 0;
  border-left: 22px solid #fff;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  margin-left: 4px;
}

.sim-player.is-playing .sim-player__icon {
  width: 18px;
  height: 22px;
  border: none;
  background:
    linear-gradient(#fff, #fff) 0 0 / 6px 100% no-repeat,
    linear-gradient(#fff, #fff) 12px 0 / 6px 100% no-repeat;
  margin-left: 0;
}

.sim-player__status {
  font-size: 0.95rem;
  opacity: 0.85;
}

.watch-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.watch-panel .platform-chip {
  position: static;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.watch-panel h1 {
  font-size: 1.45rem;
  margin-bottom: 0.75rem;
}

.watch-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.1rem 0;
}

.stat-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.stat-box__label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.stat-box__value {
  font-weight: 800;
  font-size: 1.15rem;
}

.progress-wrap {
  margin: 1.25rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #2dd4bf);
  border-radius: 999px;
  transition: width 0.25s linear;
}

.complete-feedback {
  display: none;
  text-align: center;
  padding: 1rem;
  background: #d1fae5;
  color: #047857;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 700;
}

.complete-feedback.is-visible {
  display: block;
  animation: popIn 0.35s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Rewards ---- */
.reward-card__media {
  aspect-ratio: 4 / 3;
  min-height: 140px;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  overflow: hidden;
}

.reward-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reward-card__body {
  padding: 1.1rem;
}

.reward-card h3 {
  font-size: 1.05rem;
}

.reward-card .muted {
  font-size: 0.88rem;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reward-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.75rem 0 1rem;
}

.stock-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.stock-label--available { color: #15803d; }
.stock-label--low { color: #b45309; }
.stock-label--soldout { color: #b91c1c; }

.reward-delivery-hint {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.redeem-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
}
.redeem-meta p { margin: 0; }

/* ---- Wallet ---- */
.wallet-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.summary-card--highlight {
  background: linear-gradient(135deg, #0f172a, #134e4a);
  color: #fff;
  border: none;
}

.stat-card.summary-card--highlight {
  background: linear-gradient(135deg, #0f172a, #134e4a);
  color: #fff;
  border: none;
}

.stat-card.summary-card--highlight .stat-label,
.summary-card--highlight .stat-label {
  color: rgba(255, 255, 255, 0.72);
}

.stat-card.summary-card--highlight .stat-value,
.summary-card--highlight .stat-value,
.stat-card.summary-card--highlight .points-value,
.summary-card--highlight .points-value {
  color: #fff;
}

.summary-card__label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.summary-card--highlight .summary-card__label {
  color: rgba(255, 255, 255, 0.7);
}

.summary-card__value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tx-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tx-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-soft);
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.tx-icon--earn {
  background: #d1fae5;
  color: #047857;
}

.tx-icon--spend {
  background: #ffe4e6;
  color: #be123c;
}

.tx-name {
  font-weight: 600;
}

.tx-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.tx-amount {
  font-weight: 800;
  font-size: 1.05rem;
}

.tx-amount--earn { color: #047857; }
.tx-amount--spend { color: #be123c; }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

/* ---- Profile ---- */
.profile-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
  max-width: 640px;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0f172a);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 800;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.profile-stat strong {
  display: block;
  font-size: 1.35rem;
}

.profile-stat span {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---- Modal & Toast ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 1rem;
}

.modal-overlay.is-open {
  opacity: 1;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  width: min(100%, 400px);
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  transition: transform 0.2s;
}

.modal-overlay.is-open .modal {
  transform: none;
}

.modal__title {
  margin-bottom: 0.5rem;
}

.modal__body {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: 0.25s;
  font-weight: 600;
  font-size: 0.9rem;
  max-width: 320px;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast--success { background: #047857; }
.toast--error { background: #be123c; }

/* ---- Footer ---- */
.site-footer {
  margin-top: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .hero__grid,
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .watch-panel {
    position: static;
  }

  .grid-3,
  .grid-4,
  .how-grid,
  .wallet-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1099px) {
  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: 0.4rem 0.55rem;
    font-size: 0.86rem;
  }

  .nav-points {
    padding: 0.3rem 0.6rem;
    margin-left: 0.2rem;
    font-size: 0.8rem;
  }

  .nav-auth {
    gap: 0.3rem;
    margin-left: 0.2rem;
  }

  .nav-user {
    padding: 0.15rem;
  }

  .nav-user__name {
    display: none;
  }
}

@media (max-width: 799px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    display: none;
    box-shadow: var(--shadow-md);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-link {
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
  }

  .nav-points {
    margin: 0.5rem 0 0;
    justify-content: center;
  }

  .nav-auth {
    margin: 0.5rem 0 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .nav-user__name {
    display: inline;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero h1 {
    max-width: none;
  }

  .grid-3,
  .grid-4,
  .how-grid,
  .wallet-summary,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .points-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Phase 3 Campaigns ---- */
.badge--ok {
  background: #d1fae5;
  color: #047857;
}

.badge--warn {
  background: #ffedd5;
  color: #c2410c;
}

.badge--pending {
  background: #fef3c7;
  color: #b45309;
}

.badge--revoked {
  background: #fee2e2;
  color: #b91c1c;
}

.task-campaign-line {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-campaign-line a {
  color: var(--primary-dark);
  font-weight: 600;
}

.task-campaign-line .dot {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.campaign-inline-status {
  font-weight: 600;
}

.campaign-card__cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  background: #0f172a;
}

.campaign-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.campaign-card:hover .campaign-card__cover img {
  transform: scale(1.03);
}

.campaign-status {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
}

.campaign-status--active { background: rgba(5, 150, 105, 0.92); }
.campaign-status--scheduled { background: rgba(37, 99, 235, 0.92); }
.campaign-status--paused { background: rgba(217, 119, 6, 0.92); }
.campaign-status--completed,
.campaign-status--expired { background: rgba(100, 116, 139, 0.92); }
.campaign-status--draft { background: rgba(71, 85, 105, 0.92); }

.campaign-card__body {
  padding: 1.15rem 1.2rem 1.25rem;
}

.campaign-card__brand {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.campaign-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.campaign-card h3 a:hover {
  color: var(--primary);
}

.campaign-card .muted {
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.campaign-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.75rem 0;
}

.progress-block {
  margin: 0.75rem 0 1rem;
}

.campaign-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.campaign-hero {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.campaign-hero__cover {
  aspect-ratio: 21 / 8;
  background: #0f172a;
}

.campaign-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.campaign-hero__body {
  padding: 1.5rem 1.5rem 1.75rem;
}

.campaign-hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1.5rem;
}

.campaign-stats-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.campaign-stats-box + .campaign-stats-box {
  margin-top: 0.75rem;
}

@media (max-width: 860px) {
  .campaign-hero__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Phase 4 Auth ---- */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
}

.nav-user:hover {
  background: var(--border-soft);
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0f172a);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  object-fit: cover;
}

.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  padding: 2rem 1rem 3rem;
  background:
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(13, 148, 136, 0.12), transparent 55%),
    var(--bg);
}

.auth-card {
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
}

.auth-card .muted {
  margin-bottom: 1.25rem;
}

.auth-card .form-field {
  margin-bottom: 0.9rem;
}

.auth-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="url"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.auth-card input:focus {
  outline: 2px solid rgba(13, 148, 136, 0.25);
  border-color: var(--primary);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 1rem;
}

.auth-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.auth-foot {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-foot a {
  color: var(--primary-dark);
  font-weight: 600;
}

.auth-demo {
  margin-top: 1rem;
  padding: 0.85rem;
  background: var(--bg);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.profile-edit {
  margin-top: 1.25rem;
  max-width: 640px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

@media (max-width: 720px) {
  .stat-grid,
  .how-grid { grid-template-columns: 1fr; }
  .hero__grid { grid-template-columns: 1fr; }
  .container,
  .container--wide { width: min(100% - 1.25rem, var(--content-wide)); }
  .nav-links.is-open { background: #fff; }
  .task-card__footer { flex-direction: column; align-items: stretch; }
}

/* ---- Phase 5 Task Runner UI ---- */
.task-shell {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
  align-items: start;
}

.task-shell__main {
  min-width: 0;
}

.task-shell__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.task-shell__meta .platform-chip {
  position: static;
}

.task-dynamic {
  margin-top: 1rem;
  min-height: 280px;
}

.task-dynamic .player-stage {
  /* Prefer aspect-ratio / min-height — never a fixed crush height */
  height: auto;
}

.task-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.task-box textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
  font: inherit;
}

@media (max-width: 960px) {
  .task-shell {
    grid-template-columns: 1fr;
  }
}

/* ---- Phase 7 Orders / Redeem Modal ---- */
.modal[hidden] {
  display: none !important;
}

.modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: transparent;
  padding: 1rem;
  width: auto;
  max-width: none;
  transform: none;
  box-shadow: none;
  border-radius: 0;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 12px;
  width: min(100%, 480px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}

.modal__dialog--wide {
  width: min(100%, 640px);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal__head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal__close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal:not([hidden]) .modal__body {
  padding: 1.25rem;
  color: inherit;
  margin: 0;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.reward-type-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.reward-type-hint {
  font-size: 0.78rem;
}

.badge--reward-physical {
  background: #e0e7ff;
  color: #3730a3;
}

.badge--reward-digital {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge--reward-coupon {
  background: #fce7f3;
  color: #be185d;
}

.order-row__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.order-detail {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  max-width: 720px;
}

.order-code {
  background: #f1f5f9;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-weight: 700;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.timeline-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary, #0f766e);
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.btn--danger {
  background: #be123c;
  color: #fff;
  border: none;
}

.btn--danger:hover {
  background: #9f1239;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   UI V2 — shared components
   ======================================== */

.page-title {
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.page-lead,
.section-copy {
  color: var(--text-secondary);
  max-width: 52ch;
}

.card--panel,
.card--stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card--panel:hover,
.card--stat:hover,
.summary-card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.btn--ghost {
  border-radius: 12px;
}

.badge--ok { background: #d1fae5; color: #047857; }
.badge--pending { background: #fef3c7; color: #b45309; }
.badge--warn { background: #ffedd5; color: #c2410c; }
.badge--revoked,
.badge--danger { background: #ffe4e6; color: #be123c; }
.badge--info { background: #e0f2fe; color: #0369a1; }
.badge--limited { background: #ecfeff; color: #0f766e; }
.badge--done { background: #e2e8f0; color: #334155; }

.points-balance { display: flex; flex-direction: column; gap: 0.15rem; }
.points-value { font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.points-equivalent { font-size: 0.85rem; color: var(--muted); }
.points-positive { color: var(--success); }
.points-negative { color: var(--danger); }
.points-pending { color: var(--warning); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card,
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.2rem;
}

.stat-card.summary-card--highlight {
  background: linear-gradient(135deg, #0f172a, #134e4a);
  color: #fff;
  border: none;
}

.stat-label,
.summary-card__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value,
.summary-card__value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 0.35rem;
}

.stat-meta { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1.25rem;
  align-items: start;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
}

.empty-state h2 { margin-bottom: 0.4rem; color: var(--text); }
.empty-state__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.85rem;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.rh-info,
.verify-hint {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  background: #ecfeff;
  color: #115e59;
  border: 1px solid #99f6e4;
  font-size: 0.9rem;
}

.rh-warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.site-footer {
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--nav-h));
}

.auth-layout__brand {
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(13, 148, 136, 0.2), transparent 55%),
    linear-gradient(160deg, #0f172a, #134e4a);
  color: #fff;
  padding: 4rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-layout__brand h1 { color: #fff; font-size: 2.2rem; }
.auth-layout__brand p { color: rgba(255, 255, 255, 0.78); max-width: 36ch; }

.auth-layout__form {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background: var(--bg);
}

.auth-card {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.6rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.task-card__meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.task-card h3 { font-size: 1.05rem; margin: 0.5rem 0 0.35rem; }
.task-card .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  gap: 1.25rem;
  align-items: stretch;
}

.profile-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1.35rem 1.5rem;
  height: 100%;
  min-height: 0;
}

.profile-hero h2 {
  margin: 0 0 0.25rem;
}

.profile-hero .muted {
  margin: 0;
}

.profile-hero .muted + .muted {
  margin-top: 0.35rem;
}

.profile-hero__copy {
  min-width: 0;
  flex: 1;
}

.profile-balance {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.35rem 1.5rem;
  height: 100%;
  background: linear-gradient(160deg, #0f172a 0%, #134e4a 100%);
  color: #fff;
  border: none;
}

.profile-balance .stat-label {
  color: rgba(255, 255, 255, 0.72);
}

.profile-balance__value {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
}

.profile-balance .points-equivalent {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  margin: 0.15rem 0 0;
}

.profile-balance__actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 0.35rem;
}

.profile-balance__actions .btn {
  flex: 1;
  margin: 0;
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.profile-balance__wallet {
  background: #fff;
  color: var(--text);
  border-color: transparent;
}

.profile-balance__withdraw {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  flex-wrap: wrap;
  gap: 0.2rem 0.4rem;
}

.profile-balance__withdraw .rh-mobile-only {
  color: rgba(255, 255, 255, 0.78);
}

.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.profile-mid-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
}

.profile-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.profile-activity,
.profile-share,
.profile-task-stats,
.profile-settings {
  padding: 1.25rem 1.35rem;
  min-width: 0;
}

.profile-activity .section__head {
  margin-bottom: 0.75rem;
}

.profile-activity .empty-state {
  padding: 1.5rem 1rem;
}

.profile-activity .tx-item--compact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.25rem 0.65rem 0;
}

.profile-activity .tx-item__body {
  min-width: 0;
}

.profile-activity .tx-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.profile-activity .tx-amount {
  white-space: nowrap;
  flex-shrink: 0;
}

.tx-icon--pending {
  background: #fef3c7;
  color: #b45309;
}

.profile-share h2,
.profile-task-stats h2,
.profile-settings h3 {
  margin: 0 0 0.35rem;
}

.profile-share h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.profile-share-row {
  min-width: 0;
  margin: 0.5rem 0 0.75rem;
}

.profile-share-row input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.profile-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.profile-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
  margin-top: 0.75rem;
}

.profile-mini-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.profile-mini-stat span {
  color: var(--muted);
  font-size: 0.88rem;
}

.profile-mini-stat strong {
  font-size: 1.05rem;
}

.profile-settings .form-field {
  margin-bottom: 0.85rem;
}

.profile-settings input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.profile-hero .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.wallet-summary,
.stat-grid { margin-bottom: 1.5rem; }

.order-table-card { overflow: auto; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid,
  .auth-layout { grid-template-columns: 1fr; }
  .auth-layout__brand { min-height: 220px; padding: 2.5rem 1.5rem; }
  .profile-hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  }
  .profile-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-mid-grid,
  .profile-lower-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .profile-hero-grid,
  .profile-mid-grid,
  .profile-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .stat-grid,
  .how-grid { grid-template-columns: 1fr; }
  .hero__grid { grid-template-columns: 1fr; }
  .container,
  .container--wide { width: min(100% - 1.25rem, var(--content-wide)); }
  .nav-links.is-open { background: #fff; }
  .task-card__footer { flex-direction: column; align-items: stretch; }
  .profile-hero-grid,
  .profile-kpi-grid,
  .profile-mid-grid,
  .profile-lower-grid {
    grid-template-columns: 1fr;
  }
  .profile-mid-grid {
    display: flex;
    flex-direction: column;
  }
  .profile-share { order: -1; }
  .profile-hero {
    flex-wrap: nowrap;
    align-items: center;
  }
}

.page-title { font-size: 2rem; letter-spacing: -0.03em; }
img.avatar,
img.nav-avatar { object-fit: cover; }
.card--interactive { cursor: pointer; }
.rh-error {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.rh-spinner,
.player-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rh-spin 0.8s linear infinite;
}
@keyframes rh-spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--border-soft), #fff, var(--border-soft));
  background-size: 200% 100%;
  animation: rh-skel 1.2s ease infinite;
  border-radius: var(--radius-sm);
  min-height: 1rem;
}
@keyframes rh-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.task-card__footer .points-value { font-size: 1.15rem; }
.order-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}
.order-panel { padding: 1.25rem; }
@media (max-width: 1100px) {
  .order-detail-grid { grid-template-columns: 1fr; }
}

.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.wallet-actions .btn {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wallet-withdraw-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rh-mobile-only {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.wd-lock-notice {
  margin: 0 0 1rem;
}

.wd-lock-notice p {
  margin: 0.35rem 0 0;
}

.wd-form--locked .wd-amount-group,
.wd-form--locked .wd-method,
.wd-form--locked .wd-account input,
.wd-form--locked #wdMax {
  opacity: 0.55;
}

.wd-summary--locked #wdSubmit:disabled {
  opacity: 0.65;
}

.wd-page,
.wd-head {
  max-width: 1200px;
  margin-inline: auto;
}

.wd-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
  box-shadow: var(--shadow-sm);
}

.wd-hero .stat-label {
  margin-bottom: 0.35rem;
  color: var(--text);
  opacity: 0.72;
}

.wd-hero__status {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.15rem;
}

.wd-hero__value {
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
}

.wd-hero__eur {
  color: var(--muted);
  margin: 0.2rem 0 0.65rem;
}

.wd-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.wd-form,
.wd-summary,
.wd-history-card {
  padding: 1.5rem 1.65rem;
}

.wd-form h2,
.wd-summary h3,
.wd-history-card h2 {
  margin: 0 0 1rem;
}

.wd-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.wd-amount-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 420px;
}

.wd-amount-group {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.wd-amount-group input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0.7rem 0.85rem;
}

.wd-amount-suffix {
  padding: 0 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.wd-amount-hint {
  margin: 0.4rem 0 0;
}

.field-error {
  min-height: 1.2em;
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.wd-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 420px;
}

.wd-method {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0.95rem 0.85rem 2.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.wd-method::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 1.05rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
}

.wd-method:has(:checked)::before {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 2px var(--surface);
}

.wd-method input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wd-method__title {
  font-weight: 700;
}

.wd-method__hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.wd-method:has(:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.wd-account,
.wd-account .form-field,
.wd-account input {
  max-width: 420px;
}

.wd-summary {
  align-self: start;
}

.wd-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  color: var(--muted);
}

.wd-summary__row strong {
  color: var(--text);
}

.wd-summary__row--net {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.wd-summary__row--net strong {
  font-size: 1.25rem;
  font-weight: 800;
}

.wd-summary #wdSubmit {
  margin-top: 1.15rem;
}

.wd-history-card .empty-state {
  min-height: 180px;
  max-height: 220px;
  padding: 1.35rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wd-history__head,
.wd-history__row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.9fr auto auto;
  gap: 0.75rem;
  align-items: center;
}

.wd-history__head {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.wd-history__row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.wd-cancel {
  color: var(--danger);
  border-color: transparent;
  background: transparent;
  padding-inline: 0.4rem;
}

@media (min-width: 901px) {
  .wd-summary {
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
  }
}

@media (max-width: 900px) {
  .wd-main-grid {
    grid-template-columns: 1fr;
  }
  .wd-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .wd-hero {
    flex-wrap: wrap;
  }
  .profile-balance__actions {
    flex-wrap: wrap;
  }
  .wd-methods,
  .wd-amount-row,
  .wd-account,
  .wd-account .form-field,
  .wd-account input {
    max-width: none;
    width: 100%;
  }
  .wd-methods {
    grid-template-columns: 1fr;
  }
  .wd-history__head {
    display: none;
  }
  .wd-history__row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .wd-history__row > div::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .wd-summary #wdSubmit,
  .wallet-actions .btn {
    width: 100%;
  }
}

.rh-header-app-cta {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  padding: 0.35rem 0.75rem;
  min-height: 2.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.rh-header-app-cta .rh-icon {
  flex-shrink: 0;
}

@media (min-width: 1100px) {
  .rh-header-app-cta {
    display: inline-flex;
  }
}

.hero__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.rh-app-page {
  max-width: 36rem;
  margin: 2.5rem auto 3rem;
  text-align: center;
}

.rh-app-page__mark {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.rh-app-page__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
}

.rh-app-page__sub {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.rh-app-page__lead {
  margin: 0 auto 1.5rem;
}

.rh-app-preview {
  display: flex;
  justify-content: center;
  margin: 0 0 1.5rem;
}

.rh-app-preview__phone {
  width: 132px;
  height: 232px;
  border-radius: 22px;
  border: 3px solid #0f172a;
  background: linear-gradient(160deg, #0f172a, #134e4a);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
}

.rh-app-page__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.rh-app-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: min(100%, 18rem);
}

.fb-dl {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.rh-app-page__actions > .fb-dl {
  width: min(100%, 18rem);
}

.rh-app-page__actions > .fb-dl .rh-app-cta {
  width: 100%;
  min-width: 0;
}

.rh-app-soon {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.rh-app-unavailable {
  margin: 0;
}

.rh-app-profile-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
}

.rh-app-profile-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rh-app-profile-card__copy {
  flex: 1;
  min-width: 0;
}

.rh-app-profile-card h3 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}

.rh-app-profile-card .muted {
  margin: 0;
  font-size: 0.85rem;
}

.rh-app-profile-card .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

