/* Chin Chin · página pública */
:root {
	--cc-accent: #e2557a;
	--cc-on-accent: #fff;
	--cc-hero-ink: #231f1d;
	--cc-bg1: #f7e8dc;
	--cc-bg2: #e8c3b0;
	--cc-ink: #2b2b2b;
	--cc-font: "Caveat", cursive;
	--cc-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--cc-card: #ffffff;
	--cc-muted: #7a716c;
	--cc-radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.cc-body {
	font-family: var(--cc-ui);
	color: #262220;
	background: #faf6f2;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
}
body.cc-lock { overflow: hidden; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Encabezado */
.cc-hero {
	text-align: center;
	padding: calc(28px + env(safe-area-inset-top)) 20px 26px;
	background: linear-gradient(135deg, var(--cc-bg1), var(--cc-bg2));
	color: var(--cc-hero-ink, #231f1d);
	border-radius: 0 0 28px 28px;
	position: relative;
}
.cc-hero-logo { max-width: 150px; max-height: 90px; object-fit: contain; display: block; margin: 0 auto 6px; }
.cc-title { font-family: var(--cc-font); font-weight: 700; font-size: clamp(40px, 11vw, 68px); line-height: 1; margin: 6px 0 4px; }
.cc-date { font-family: var(--cc-font); font-size: 24px; margin: 0; opacity: .85; }
.cc-welcome { max-width: 520px; margin: 12px auto 0; font-size: 15px; line-height: 1.45; opacity: .9; }
.cc-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 16px 0 12px; font-size: 14px; }
.cc-stats span { background: rgba(255,255,255,.55); padding: 5px 10px; border-radius: 999px; }
.cc-share-btn { background: rgba(255,255,255,.75) !important; }
.cc-hero-dark .cc-stats span { background: rgba(255,255,255,.14); }
.cc-hero-dark .cc-share-btn { background: rgba(255,255,255,.16) !important; color: #fff; border-color: rgba(255,255,255,.3); }
.cc-hero-dark .cc-date, .cc-hero-dark .cc-welcome { opacity: .92; }

.cc-guest-bar { text-align: center; font-size: 14px; padding: 12px 16px 0; color: var(--cc-muted); }

/* Barra */
.cc-toolbar {
	position: sticky; top: 0; z-index: 20;
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 10px 14px;
	background: rgba(250,246,242,.92);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cc-tabs { display: flex; background: #efe8e2; border-radius: 999px; padding: 4px; }
.cc-tab { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: #5f5650; }
.cc-tab.is-active { background: #fff; color: #1e1a18; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cc-select { border: 1px solid #e3dad3; background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 14px; color: #3a3330; }

main { max-width: 1200px; margin: 0 auto; padding: 0 10px 130px; }

/* Chips */
.cc-chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px 12px; scrollbar-width: none; }
.cc-chips::-webkit-scrollbar { display: none; }
.cc-chip { flex: 0 0 auto; border: 1px solid #e6ddd6; background: #fff; color: #3a3330; padding: 7px 13px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
.cc-chip small { opacity: .55; margin-left: 3px; }
.cc-chip.is-active { background: var(--cc-accent); border-color: var(--cc-accent); color: var(--cc-on-accent); }
.cc-chip.is-active small { opacity: .85; }
.cc-chip-me { border-color: var(--cc-accent); }

/* Grilla */
.cc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 700px) { .cc-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; } }
@media (min-width: 1000px) { .cc-grid { grid-template-columns: repeat(5, 1fr); } }
.cc-tile { position: relative; aspect-ratio: 1 / 1; border: 0; padding: 0; overflow: hidden; background: #e9e2dc; border-radius: 6px; display: block; width: 100%; animation: cc-in .35s ease both; }
.cc-tile img, .cc-tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; pointer-events: none; }
.cc-tile:hover img { transform: scale(1.04); }
.cc-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; padding-left: 3px; }
.cc-tile-info { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; padding: 18px 6px 5px; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; font-size: 11px; text-align: left; }
.cc-tile-author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-tile-likes { flex: 0 0 auto; font-weight: 700; }
.cc-tile-likes.is-on, .cc-top-likes.is-on { color: #ff6b8b; }
@keyframes cc-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.cc-empty { text-align: center; padding: 50px 20px; color: var(--cc-muted); }
.cc-empty-icon { font-size: 54px; }
.cc-loader { display: flex; justify-content: center; gap: 6px; padding: 24px; }
.cc-loader span { width: 9px; height: 9px; border-radius: 50%; background: var(--cc-accent); animation: cc-dot 1s infinite ease-in-out; }
.cc-loader span:nth-child(2) { animation-delay: .15s; } .cc-loader span:nth-child(3) { animation-delay: .3s; }
@keyframes cc-dot { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* Top */
.cc-h2 { font-family: var(--cc-font); font-size: 34px; margin: 18px 6px 10px; }
.cc-top-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 800px) { .cc-top-list { grid-template-columns: repeat(4, 1fr); } }
.cc-top-card { position: relative; border: 0; background: #fff; padding: 8px 8px 10px; border-radius: 6px; box-shadow: 0 6px 20px rgba(60,40,30,.12); text-align: left; display: flex; flex-direction: column; gap: 8px; }
.cc-top-card:nth-child(odd) { transform: rotate(-1.2deg); } .cc-top-card:nth-child(even) { transform: rotate(1.2deg); }
.cc-top-card.is-podium:first-child { grid-column: 1 / -1; }
@media (min-width: 800px) { .cc-top-card.is-podium:first-child { grid-column: span 2; grid-row: span 2; } }
.cc-top-media { position: relative; display: block; aspect-ratio: 1/1; overflow: hidden; background: #eee; }
.cc-top-media img, .cc-top-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-rank { position: absolute; top: -8px; left: -6px; z-index: 2; font-size: 26px; background: #fff; border-radius: 50%; min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(0,0,0,.15); font-weight: 800; font-size: 15px; }
.cc-top-card.is-podium .cc-rank { font-size: 26px; }
.cc-top-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; padding: 0 2px; }
.cc-top-author { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.cc-top-likes { font-weight: 800; color: var(--cc-accent); }
.cc-top-stats { width: 100%; display: flex; gap: 10px; font-size: 12px; color: var(--cc-muted); }
.cc-top-people { display: grid; gap: 8px; }
.cc-person { position: relative; display: flex; align-items: center; gap: 12px; border: 0; background: #fff; border-radius: 14px; padding: 12px 14px 12px 60px; text-align: left; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.cc-person .cc-rank { top: 50%; left: 12px; transform: translateY(-50%); box-shadow: none; background: #f6efe9; }
.cc-person b { flex: 1; }
.cc-person span:last-child { color: var(--cc-muted); font-size: 13px; }

/* Botón flotante */
.cc-fab {
	position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
	bottom: calc(18px + env(safe-area-inset-bottom));
	background: var(--cc-accent); color: var(--cc-on-accent); font-weight: 700; font-size: 16px;
	padding: 16px 26px; border-radius: 999px; cursor: pointer; white-space: nowrap;
	box-shadow: 0 10px 30px rgba(0,0,0,.25); user-select: none;
	transition: transform .15s;
}
.cc-fab:active { transform: translateX(-50%) scale(.96); }

/* Modales */
.cc-modal { position: fixed; inset: 0; z-index: 60; background: rgba(20,15,12,.55); display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: cc-fade .2s; }
@media (min-width: 600px) { .cc-modal { align-items: center; padding: 20px; } }
.cc-modal-card { position: relative; width: 100%; max-width: 440px; background: #fff; border-radius: 24px 24px 0 0; padding: 26px 22px calc(24px + env(safe-area-inset-bottom)); animation: cc-up .25s ease; max-height: 92vh; overflow: auto; }
@media (min-width: 600px) { .cc-modal-card { border-radius: 24px; } }
.cc-modal-card h3 { margin: 0 0 8px; font-size: 22px; }
.cc-modal-emoji { font-size: 40px; }
.cc-x { position: absolute; top: 10px; right: 12px; border: 0; background: #f3eee9; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; color: #555; }
.cc-muted { color: var(--cc-muted); font-size: 14px; line-height: 1.45; }
.cc-center { text-align: center; }
.cc-input { display: block; width: 100%; padding: 14px 16px; margin: 0 0 10px; border: 1px solid #e3dad3; border-radius: 12px; font-size: 16px; background: #fbf9f7; }
.cc-input:focus { outline: 2px solid var(--cc-accent); border-color: transparent; background: #fff; }
.cc-btn { display: block; width: 100%; text-align: center; background: var(--cc-accent); color: var(--cc-on-accent); border: 0; padding: 15px; border-radius: 14px; font-size: 16px; font-weight: 700; margin-top: 6px; cursor: pointer; }
.cc-btn:disabled { opacity: .6; }
.cc-link { background: none; border: 0; color: var(--cc-accent); font-weight: 600; padding: 6px; text-decoration: underline; }
.cc-error { color: #c0392b; font-size: 14px; margin: 0 0 8px; }
.cc-option { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; gap: 2px; border: 1px solid #ebe3dc; background: #fbf9f7; border-radius: 14px; padding: 14px 16px; margin-top: 10px; }
.cc-option:hover { border-color: var(--cc-accent); }
.cc-option span { font-size: 13px; color: var(--cc-muted); }
.cc-dl-img { background: #f3eee9; border-radius: 12px; padding: 10px; margin-bottom: 8px; text-align: center; }
.cc-dl-img img { max-width: 100%; max-height: 55vh; border-radius: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.cc-qr { width: 240px; height: 240px; margin: 10px auto 14px; display: block; border-radius: 12px; }
@keyframes cc-fade { from { opacity: 0; } }
@keyframes cc-up { from { transform: translateY(30px); opacity: 0; } }

/* Panel de subida */
.cc-upload-panel { position: fixed; z-index: 50; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; background: #fff; border-radius: 20px; box-shadow: 0 14px 40px rgba(0,0,0,.25); padding: 14px; animation: cc-up .25s; }
.cc-up-head { display: flex; align-items: center; gap: 10px; }
.cc-up-head > div { flex: 1; }
.cc-progress { display: block; height: 6px; background: #f0e9e3; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.cc-progress i { display: block; height: 100%; width: 0; background: var(--cc-accent); transition: width .2s; }
.cc-up-list { max-height: 38vh; overflow: auto; margin-top: 10px; display: grid; gap: 8px; }
.cc-upload-panel.is-min .cc-up-list, .cc-upload-panel.is-min .cc-up-foot { display: none; }
.cc-up-item { display: flex; gap: 10px; align-items: center; }
.cc-up-thumb { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; overflow: hidden; background: #f3eee9; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.cc-up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cc-up-body { flex: 1; min-width: 0; }
.cc-up-name { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-up-status { display: block; font-size: 12px; color: var(--cc-muted); margin-top: 3px; }
.cc-up-item.is-done .cc-progress i { background: #2ecc71; }
.cc-up-item.is-error .cc-up-status { color: #c0392b; }
.cc-up-item.is-error .cc-progress i { background: #e74c3c; width: 100% !important; }
.cc-up-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* Visor */
.cc-lightbox { position: fixed; inset: 0; z-index: 55; background: #0d0b0a; color: #fff; display: flex; flex-direction: column; animation: cc-fade .2s; }
.cc-lb-top { display: flex; justify-content: space-between; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
.cc-lb-count { font-size: 13px; opacity: .7; }
.cc-lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.cc-lb-stage img, .cc-lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.cc-burst { position: absolute; top: 50%; left: 50%; font-size: 110px; color: #ff4d6d; transform: translate(-50%,-50%) scale(0); opacity: 0; pointer-events: none; text-shadow: 0 6px 30px rgba(0,0,0,.4); }
.cc-burst.go { animation: cc-burst .8s ease; }
@keyframes cc-burst { 0% { transform: translate(-50%,-50%) scale(0); opacity: 0; } 25% { transform: translate(-50%,-50%) scale(1.2); opacity: 1; } 60% { transform: translate(-50%,-50%) scale(1); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(1.1); opacity: 0; } }
.cc-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 30px; line-height: 1; }
.cc-lb-prev { left: 10px; } .cc-lb-next { right: 10px; }
@media (hover: none) { .cc-lb-nav { display: none; } }
.cc-lb-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.cc-lb-info { flex: 1; min-width: 0; }
.cc-lb-author { background: none; border: 0; color: #fff; font-weight: 700; padding: 0; font-size: 15px; text-align: left; }
.cc-lb-time { font-size: 12px; opacity: .6; margin-left: 6px; }
.cc-lb-stats { display: flex; gap: 12px; font-size: 13px; opacity: .85; margin-top: 4px; }
.cc-lb-actions { display: flex; gap: 8px; }
.cc-lb-btn { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; line-height: 1; }
.cc-heart-btn { border: 0; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; transition: background .2s; }
.cc-heart-btn.is-on { background: #ff4d6d; }
.cc-heart-btn.pop { animation: cc-pop .35s; }
@keyframes cc-pop { 50% { transform: scale(1.25); } }

/* Toast */
.cc-toast { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); top: calc(16px + env(safe-area-inset-top)); background: #1f1b19; color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; text-align: center; animation: cc-fade .2s; }

/* Portada /chinchin */
.cc-home { background: linear-gradient(135deg, #f7e8dc, #e8c3b0); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.cc-home-wrap { text-align: center; padding: 40px 22px; max-width: 520px; }
.cc-home-logo { font-size: 64px; }
.cc-home .cc-title { font-family: "Caveat", cursive; }
.cc-home-lead { font-size: 18px; color: #4a3f3a; }
.cc-home-hint { background: rgba(255,255,255,.6); border-radius: 16px; padding: 16px; }
.cc-home-list { display: grid; gap: 10px; margin-top: 20px; }
.cc-home-card { display: flex; flex-direction: column; background: #fff; border-radius: 14px; padding: 14px 18px; text-decoration: none; color: #262220; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.cc-home-card span { color: #7a716c; font-size: 14px; }
