/* ============================================================
   topdevphone — Cloutgram app styles
   Instagram-flavoured gradient identity (#f09433 → #dc2743).
   Everything is drawn with CSS/inline SVG: the gradient media
   tokens ('grad:<name>' — see nui/js/apps/cloutgram.js header)
   are pure CSS so the phone needs no remote images at all.
   Uses base.css chrome + CSS vars, so dark AND light both work.
   ============================================================ */

/* ------------------------------------------------------------
   Media tokens — 'grad:sunset1' renders <div class="cg-media cg-g-sunset1">
   Each is a layered gradient so it reads like an abstract photo.
   ------------------------------------------------------------ */
.cg-media {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover; background-color: var(--bg-tertiary);
  -webkit-user-drag: none;
}
.cg-media.tile { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.cg-media.full { width: 100%; height: 100%; aspect-ratio: auto; }

.cg-g-sunset1 {
  background:
    radial-gradient(80% 60% at 25% 20%, rgba(255, 236, 179, 0.75), transparent 60%),
    radial-gradient(90% 70% at 80% 90%, rgba(194, 24, 91, 0.85), transparent 65%),
    linear-gradient(155deg, #ff9966 0%, #ff5e62 45%, #b8144f 100%);
}
.cg-g-ocean1 {
  background:
    radial-gradient(70% 55% at 20% 15%, rgba(180, 255, 236, 0.6), transparent 60%),
    radial-gradient(90% 80% at 85% 95%, rgba(12, 42, 96, 0.85), transparent 65%),
    linear-gradient(160deg, #43cea2 0%, #2b8bb4 55%, #185a9d 100%);
}
.cg-g-neon1 {
  background:
    radial-gradient(65% 50% at 75% 18%, rgba(0, 210, 255, 0.65), transparent 60%),
    radial-gradient(80% 70% at 20% 90%, rgba(255, 0, 128, 0.55), transparent 65%),
    linear-gradient(150deg, #8e2de2 0%, #4a00e0 60%, #12005e 100%);
}
.cg-g-mint1 {
  background:
    radial-gradient(75% 55% at 30% 20%, rgba(245, 255, 200, 0.7), transparent 62%),
    radial-gradient(85% 75% at 85% 95%, rgba(20, 90, 45, 0.7), transparent 65%),
    linear-gradient(155deg, #a8e063 0%, #6cc04a 50%, #2f7d32 100%);
}
.cg-g-noir1 {
  background:
    radial-gradient(60% 45% at 70% 12%, rgba(255, 255, 255, 0.28), transparent 60%),
    radial-gradient(90% 80% at 25% 95%, rgba(0, 0, 0, 0.9), transparent 60%),
    linear-gradient(150deg, #5c5c66 0%, #2b2b31 55%, #0a0a0c 100%);
}
.cg-g-candy1 {
  background:
    radial-gradient(70% 55% at 20% 18%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(80% 70% at 85% 92%, rgba(255, 106, 136, 0.85), transparent 65%),
    linear-gradient(150deg, #ffc3a0 0%, #ff99ac 45%, #ff5f8f 100%);
}
.cg-g-fallback {
  background:
    radial-gradient(70% 60% at 30% 25%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(150deg, #6a6a75, #33333b);
}

.cg-swatch {
  width: 34px; height: 34px; border-radius: 9px; display: inline-block;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* ------------------------------------------------------------
   Avatars + story rings
   ------------------------------------------------------------ */
.cg-av {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0.3px;
  flex: 0 0 auto; overflow: hidden;
}
.cg-av.sm { width: 30px; height: 30px; font-size: 12.5px; }
.cg-av.lg { width: 66px; height: 66px; font-size: 26px; }
.cg-av-0 { background: linear-gradient(140deg, #f09433, #dc2743); }
.cg-av-1 { background: linear-gradient(140deg, #4facfe, #00f2fe); }
.cg-av-2 { background: linear-gradient(140deg, #a18cd1, #fbc2eb); }
.cg-av-3 { background: linear-gradient(140deg, #43e97b, #38f9d7); }
.cg-av-4 { background: linear-gradient(140deg, #fa709a, #fee140); }
.cg-av-5 { background: linear-gradient(140deg, #30cfd0, #330867); }

.cg-ring {
  display: inline-flex; padding: 2.5px; border-radius: 50%;
  background: conic-gradient(from 210deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888, #f09433);
}
.cg-ring.off { background: var(--bg-tertiary); }
.cg-ring.big { padding: 3px; }
.cg-ring-in {
  display: inline-flex; padding: 2.5px; border-radius: 50%;
  background: var(--bg-primary);
}

/* ------------------------------------------------------------
   Stories rail
   ------------------------------------------------------------ */
.cg-rail {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
  padding: 8px 14px 12px; margin: 0 -14px;
  border-bottom: 1px solid var(--separator);
  scrollbar-width: none;
}
.cg-rail::-webkit-scrollbar { height: 0; }
.cg-story-btn {
  position: relative; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 66px;
}
.cg-story-btn:active .cg-ring { transform: scale(0.94); }
.cg-story-btn .cg-ring { transition: transform 0.15s; }
.cg-story-name {
  font-size: 10.5px; color: var(--text-secondary);
  max-width: 66px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cg-story-plus {
  position: absolute; right: 6px; top: 30px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  border: 2px solid var(--bg-primary);
}
.cg-story-plus .ic { width: 10px; height: 10px; }

/* new-post pill */
.cg-newpill {
  display: block; width: 100%; margin: 8px 0 2px; padding: 8px;
  border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, #f09433, #dc2743);
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
}
.cg-newpill.hidden { display: none; }

/* ------------------------------------------------------------
   Feed cards
   ------------------------------------------------------------ */
.cg-feed { margin: 0 -14px; }
.cg-card { padding-bottom: 10px; border-bottom: 1px solid var(--separator); }
.cg-card:last-child { border-bottom: 0; }
.cg-card-head { display: flex; align-items: center; gap: 9px; padding: 10px 14px; }
.cg-handle { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.cg-you {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text-secondary); background: var(--bg-tertiary);
  border-radius: 6px; padding: 2px 6px;
}
.cg-more { margin-left: auto; color: var(--text-secondary); font-size: 18px; display: flex; }

.cg-mediabox { position: relative; }
.cg-carousel { position: relative; overflow: hidden; touch-action: pan-y; background: var(--bg-tertiary); }
.cg-track { display: flex; will-change: transform; }
.cg-slide { flex: 0 0 100%; min-width: 100%; }
.cg-counter {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 12px; padding: 3px 9px;
  backdrop-filter: blur(6px); pointer-events: none;
}
.cg-heartpop {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 92px; opacity: 0; pointer-events: none;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}
.cg-heartpop.pop { animation: cgHeart 0.78s cubic-bezier(0.28, 1.4, 0.5, 1); }
@keyframes cgHeart {
  0% { opacity: 0; transform: scale(0.3); }
  30% { opacity: 1; transform: scale(1.08); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.94); }
}
.cg-dots { display: flex; justify-content: center; gap: 5px; padding: 8px 0 2px; }
.cg-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--bg-tertiary); transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.cg-dot.on { background: var(--accent-blue); transform: scale(1.15); }

.cg-actions { display: flex; align-items: center; gap: 16px; padding: 8px 14px 2px; }
.cg-act { font-size: 23px; color: var(--text-primary); display: flex; transition: transform 0.12s; }
.cg-act:active { transform: scale(0.86); }
.cg-act.liked { color: var(--accent-red); }
.cg-act-end { margin-left: auto; font-size: 20px; color: var(--text-secondary); }

.cg-likes { padding: 4px 14px 0; font-size: 13px; font-weight: 700; }
.cg-caption {
  padding: 4px 14px 0; font-size: 13.5px; line-height: 1.4;
  color: var(--text-primary); word-break: break-word;
}
.cg-caption b { font-weight: 700; margin-right: 5px; }
.cg-viewall {
  display: block; padding: 5px 14px 0; font-size: 12.5px; color: var(--text-secondary);
  text-align: left;
}
.cg-viewall.dim { color: var(--text-tertiary); }
.cg-time {
  padding: 5px 14px 0; font-size: 10.5px; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-tertiary);
}

/* ------------------------------------------------------------
   Explore / profile grids
   ------------------------------------------------------------ */
.cg-explore-head {
  font-size: 12px; color: var(--text-secondary); padding: 8px 2px 10px; font-weight: 600;
}
.cg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  margin: 0 -14px;
}
.cg-tile { position: relative; display: block; overflow: hidden; background: var(--bg-tertiary); }
.cg-tile:active { filter: brightness(0.85); }
.cg-tile-multi {
  position: absolute; top: 6px; right: 6px; color: #fff; font-size: 12px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); pointer-events: none;
}
.cg-tile-likes {
  position: absolute; left: 6px; bottom: 5px;
  display: flex; align-items: center; gap: 3px;
  color: #fff; font-size: 10.5px; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); pointer-events: none;
}
.cg-tile-likes .ic { width: 11px; height: 11px; }

.cg-profile { display: flex; align-items: center; gap: 16px; padding: 12px 2px 14px; }
.cg-profile-main { min-width: 0; }
.cg-profile-handle { font-size: 18px; font-weight: 800; }
.cg-profile-stats { display: flex; gap: 16px; margin-top: 6px; font-size: 12.5px; color: var(--text-secondary); }
.cg-profile-stats b { color: var(--text-primary); font-weight: 800; }
.cg-profile-btn { margin-bottom: 16px; }

/* ------------------------------------------------------------
   New post composer
   ------------------------------------------------------------ */
.cg-nrow { margin: 6px 0 12px; }
.cg-nthumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cg-nthumbs::-webkit-scrollbar { height: 0; }
.cg-nthumb { position: relative; flex: 0 0 auto; width: 96px; border-radius: 12px; overflow: hidden; }
.cg-nthumb-x {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; backdrop-filter: blur(4px);
}
.cg-nthumb-x .ic { width: 11px; height: 11px; }
.cg-nempty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  height: 132px; border-radius: var(--radius-card-lg);
  border: 1.5px dashed var(--separator); color: var(--text-tertiary); font-size: 12.5px;
}
.cg-nempty .ic { width: 30px; height: 30px; opacity: 0.6; }
.cg-npick { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.cg-npick .ic { width: 17px; height: 17px; }
.cg-npresets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.cg-npreset {
  height: 68px; border-radius: 12px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s;
}
.cg-npreset:active { transform: scale(0.95); }
.cg-ncap { margin-bottom: 4px; line-height: 1.4; }
.cg-nstory { background: var(--bg-secondary); border-radius: var(--radius-card); margin: 14px 0 18px; }
.cg-share { background: linear-gradient(120deg, #f09433, #dc2743); }

/* ------------------------------------------------------------
   Handle claim gate
   ------------------------------------------------------------ */
.cg-gate .tabbar { display: none; }
.cg-claim { padding: 10px 6px 30px; text-align: center; }
.cg-claim-logo {
  width: 74px; height: 74px; margin: 6px auto 16px; border-radius: var(--radius-app);
  background: linear-gradient(140deg, #f09433, #dc2743);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 38px;
  box-shadow: 0 10px 26px rgba(220, 39, 67, 0.35);
}
.cg-claim-title { font-size: 24px; font-weight: 800; }
.cg-claim-sub { font-size: 13px; color: var(--text-secondary); margin: 8px 10px 18px; line-height: 1.45; }
.cg-claim-strip { display: flex; gap: 7px; justify-content: center; margin-bottom: 22px; }
.cg-claim-field {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-tertiary); border-radius: 12px; padding: 4px 12px;
}
.cg-claim-field span { font-size: 17px; font-weight: 800; color: var(--text-tertiary); }
.cg-claim-input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--text-primary); font-size: 16px; font-weight: 700; padding: 10px 0;
}
.cg-claim-hint { font-size: 11.5px; color: var(--text-tertiary); margin: 10px 0 18px; }
.cg-claim-btn { background: linear-gradient(120deg, #f09433, #dc2743); }
.cg-modal-note {
  text-align: center; color: var(--text-secondary); font-size: 13px;
  margin-bottom: 14px; line-height: 1.4;
}

/* ------------------------------------------------------------
   Overlays (comment sheet · story viewer · post detail)
   ------------------------------------------------------------ */
.cg-overlay { position: absolute; inset: 0; z-index: 6; }
.cg-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }

.cg-sheet-wrap { display: flex; align-items: flex-end; }
.cg-sheet {
  position: relative; width: 100%; height: 76%;
  background: var(--bg-elevated); color: var(--text-primary);
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
  animation: cgSheetUp 0.28s cubic-bezier(0.32, 0.72, 0.35, 1);
}
@keyframes cgSheetUp { from { transform: translateY(70%); } }
.cg-grab { width: 38px; height: 4px; border-radius: 3px; background: var(--bg-tertiary); margin: 8px auto 2px; }
.cg-sheet-head {
  display: flex; align-items: center; padding: 6px 14px 10px;
  border-bottom: 1px solid var(--separator);
}
.cg-sheet-title { flex: 1; text-align: center; font-size: 15px; font-weight: 800; }
.cg-sheet-x { position: absolute; right: 12px; top: 14px; color: var(--text-secondary); font-size: 15px; display: flex; }
.cg-clist { flex: 1; overflow-y: auto; padding: 10px 14px 6px; }
.cg-clist::-webkit-scrollbar { width: 0; }
.cg-crow { display: flex; gap: 10px; padding: 8px 0; }
.cg-cmain { flex: 1; min-width: 0; }
.cg-cbody { font-size: 13.5px; line-height: 1.4; word-break: break-word; }
.cg-cbody b { font-weight: 700; margin-right: 5px; }
.cg-cmeta { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.cg-composer {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px 16px; border-top: 1px solid var(--separator);
}
.cg-cinput {
  flex: 1; min-width: 0; background: var(--bg-tertiary); border: 0; outline: none;
  border-radius: 18px; padding: 9px 14px; font-size: 13.5px; color: var(--text-primary);
}
.cg-cinput::placeholder { color: var(--text-tertiary); }
.cg-cpost { font-size: 13.5px; font-weight: 800; color: var(--accent-blue); flex: 0 0 auto; }

.cg-story-viewer { background: #000; overflow: hidden; }
.cg-story-media { position: absolute; inset: 0; }
.cg-story-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 22%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent 28%);
}
.cg-segs { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; }
.cg-seg { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.32); overflow: hidden; }
.cg-seg i { display: block; height: 100%; width: 0; background: #fff; border-radius: 2px; }
.cg-seg.done i { width: 100%; }
.cg-seg.live i { animation-name: cgSeg; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes cgSeg { from { width: 0; } to { width: 100%; } }
.cg-story-head {
  position: absolute; top: 22px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 9px; color: #fff; z-index: 3;
}
.cg-story-head .cg-av.ring { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.cg-story-handle { font-size: 13.5px; font-weight: 800; }
.cg-story-time { font-size: 11.5px; opacity: 0.75; }
.cg-story-act { margin-left: auto; color: #fff; opacity: 0.85; font-size: 16px; display: flex; }
.cg-story-x { color: #fff; opacity: 0.9; font-size: 16px; display: flex; }
.cg-story-caption {
  position: absolute; left: 16px; right: 16px; bottom: 32px; z-index: 3;
  color: #fff; font-size: 14.5px; font-weight: 600; line-height: 1.4;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); word-break: break-word;
}
.cg-tap { position: absolute; top: 60px; bottom: 0; z-index: 2; background: transparent; }
.cg-tap-prev { left: 0; width: 32%; }
.cg-tap-next { right: 0; width: 68%; }

.cg-detail-wrap { background: var(--bg-primary); display: flex; flex-direction: column; }
.cg-detail-head { flex: 0 0 auto; border-bottom: 1px solid var(--separator); }
.cg-detail-body { flex: 1; overflow-y: auto; padding-bottom: 40px; }
.cg-detail-body::-webkit-scrollbar { width: 0; }

/* ------------------------------------------------------------
   Home-screen widget
   ------------------------------------------------------------ */
.cg-w-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.cg-w-tile { display: block; border-radius: 9px; overflow: hidden; }
.cg-w-note { font-size: 11.5px; opacity: 0.7; margin-top: 8px; }

/* wordmark: gradient title in the feed header */
.cg-wordmark {
  background: linear-gradient(100deg, #f09433, #dc2743 60%, #bc1888);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
