/* ===== Koyin Girl cards: front = their review, back = their sticker collage ===== */
.kc { --bg: #2E1A16; --ink: #FBEDE6; --soft: rgba(251, 237, 230, .72); --accent: #F4A3B0; --chip: rgba(255, 255, 255, .12);
  position: relative; aspect-ratio: 5 / 7; perspective: 1400px; container-type: inline-size; }
.kc[data-theme="cherry"] { --bg: #B81B33; --ink: #FFF3F3; --soft: rgba(255, 243, 243, .78); --accent: #FFD3DC; }
.kc[data-theme="pink"] { --bg: #F6B6C4; --ink: #3A1520; --soft: rgba(58, 21, 32, .72); --accent: #B81B33; --chip: rgba(255, 255, 255, .55); }
.kc[data-theme="forest"] { --bg: #1E5C3A; --ink: #F3FBEF; --soft: rgba(243, 251, 239, .76); --accent: #FFC9D3; }
.kc[data-theme="cream"] { --bg: #F7EBDD; --ink: #2E1A16; --soft: rgba(46, 26, 22, .7); --accent: #C8203A; --chip: rgba(46, 26, 22, .07); }
.kc[data-theme="lilac"] { --bg: #C9B6EA; --ink: #2A1840; --soft: rgba(42, 24, 64, .72); --accent: #7A3FBF; --chip: rgba(255, 255, 255, .5); }

.kc-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, 1.4, .5, 1); }
.kc.flipped .kc-inner { transform: rotateY(180deg); }
.kc-face { position: absolute; inset: 0; overflow: hidden; border-radius: 6cqw; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background-color: var(--bg); color: var(--ink);
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.3px), radial-gradient(rgba(0, 0, 0, .06) 1px, transparent 1.3px);
  background-size: 9px 9px, 13px 13px; background-position: 0 0, 4px 6px;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .12), 0 26px 44px -26px rgba(46, 26, 22, .7), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.kc-back { transform: rotateY(180deg); }

/* front */
.kc-front { display: flex; flex-direction: column; padding: 6cqw 6.5cqw 6cqw; gap: 2.6cqw; }
.kc-photo { position: relative; flex: 0 0 auto; height: 52%; margin: 1cqw 2cqw 2cqw; transform: rotate(-2.5deg); border: 2.4cqw solid #fff; border-radius: 3cqw; overflow: hidden; box-shadow: 0 2cqw 5cqw -2cqw rgba(0, 0, 0, .45); background: #eee; }
.kc-photo img { width: 100%; height: 100%; object-fit: cover; }
.kc-photo.empty { display: grid; place-items: center; background: repeating-linear-gradient(-45deg, #fff 0 8px, #f6e9e7 8px 16px); color: #b9a19b; font: 700 4cqw var(--body); }
.kc-badge svg { width: 3cqw; height: 3cqw; vertical-align: -.5cqw; margin-right: .6cqw; stroke-width: 3; }
.kc-badge { position: absolute; left: 2.5cqw; bottom: 2.5cqw; padding: 1cqw 2.6cqw; border-radius: 99px; background: rgba(255, 255, 255, .94); color: #1E7A46; font: 700 3cqw/1.2 var(--body); }
.kc-stars { color: #F7B740; font-size: 4.4cqw; line-height: 1; display: flex; gap: .6cqw; }
.kc-stars svg { display: block; }
.kc-stars span { opacity: .25; }
.kc-quote { margin: 0; font-family: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive; font-weight: 700; font-size: 6.4cqw; line-height: 1.05; }
.kc-name { margin: auto 0 0; font-family: var(--display); font-weight: 800; font-size: 7.4cqw; line-height: 1; letter-spacing: -.02em; }
.kc-where { font: 600 3.4cqw var(--body); color: var(--soft); display: inline-flex; align-items: center; gap: .8cqw; vertical-align: middle; }
.kc-where svg { width: 3.4cqw; height: 3.4cqw; }
.kc-socials { display: flex; flex-wrap: wrap; gap: 1.6cqw 3cqw; }
.kc-socials a { display: inline-flex; align-items: center; gap: 1.4cqw; color: var(--ink); text-decoration: none; font: 700 3.3cqw var(--body); }
.kc-socials svg { width: 4.2cqw; height: 4.2cqw; flex: 0 0 auto; }
.kc-shades { display: flex; flex-wrap: wrap; gap: 1.4cqw; }
.kc-shades span { display: inline-flex; align-items: center; gap: 1.3cqw; padding: .9cqw 2.4cqw .9cqw 1cqw; border-radius: 99px; background: var(--chip); font: 700 3cqw var(--body); }
.kc-shades i { width: 3.4cqw; height: 3.4cqw; border-radius: 50%; box-shadow: 0 0 0 .5cqw rgba(255, 255, 255, .6); }
.kc-corner { position: absolute; right: 5cqw; top: 5cqw; font: 700 2.8cqw var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.kc-flip-hint svg { width: 4cqw; height: 4cqw; }
.kc-flip-hint { position: absolute; right: 4.5cqw; bottom: 4.5cqw; width: 8cqw; height: 8cqw; display: grid; place-items: center; border-radius: 50%; background: var(--chip); color: var(--ink); font-size: 4cqw; }

/* back: the collage */
.kc-stage { position: absolute; inset: 0; z-index: 1; }
.kc-draw { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.kc-sig { z-index: 3; position: absolute; left: 5cqw; bottom: 4.5cqw; display: flex; align-items: center; gap: 2cqw; font: 700 3cqw var(--body); color: var(--soft); pointer-events: none; }
.kc-sig svg { width: 2.8cqw; height: 2.8cqw; margin: 0 .4cqw; }
.kc-sig img { width: 14cqw; filter: drop-shadow(0 0 1px rgba(255,255,255,.8)); }
.st { position: absolute; transform-origin: 50% 50%; touch-action: none; user-select: none; -webkit-user-select: none; }
.st img, .st svg { display: block; width: 100%; height: auto; pointer-events: none; }
.st-photo img { border: 2.2cqw solid #fff; border-radius: 3cqw; box-shadow: 0 1.6cqw 3cqw -1cqw rgba(0, 0, 0, .45); aspect-ratio: 4 / 5; object-fit: cover; }
.st-cut img { filter: drop-shadow(0 1.2cqw 1.6cqw rgba(0, 0, 0, .35)); }
.st-doodle { color: var(--ink); }
.st-doodle svg { overflow: visible; }
.st-text { font-family: 'Caveat', 'Bradley Hand', cursive; font-weight: 700; color: var(--ink); white-space: nowrap; line-height: 1; text-align: center; }

/* editing helpers (only in the card maker) */
.kc.editing .st { cursor: grab; }
.kc.editing .st.sel { outline: 2px dashed rgba(255, 255, 255, .9); outline-offset: 4px; z-index: 50 !important; }
.st .h-rot, .st .h-del { display: none; position: absolute; width: 30px; height: 30px; border-radius: 50%; border: 0; place-items: center; font: 700 15px/1 var(--body); box-shadow: 0 4px 10px rgba(0, 0, 0, .35); cursor: pointer; touch-action: none; }
.st.sel .h-rot, .st.sel .h-del { display: grid; }
.st .h-rot svg, .st .h-del svg { width: 15px; height: 15px; }
.st .h-rot { right: -18px; bottom: -18px; background: #fff; color: #2E1A16; cursor: nwse-resize; }
.st .h-del { left: -18px; top: -18px; background: #C8203A; color: #fff; }
.kc.drawing .kc-draw { pointer-events: auto; cursor: crosshair; touch-action: none; }
.kc-badge-solo { position: static; align-self: flex-start; margin-top: 6cqw; }
.kc-quote.big { font-size: 10cqw; margin-top: 4cqw; }

/* ---------- photo: crop, frame size, frame style ---------- */
.kc-photo img { object-position: var(--px, 50%) var(--py, 50%); transform: scale(var(--pz, 1)); transform-origin: var(--px, 50%) var(--py, 50%); }
.kc.editing .kc-photo:not(.empty) { cursor: grab; touch-action: none; }
.kc-front[data-size="s"] .kc-photo { height: 38%; }
.kc-front[data-size="l"] .kc-photo { height: 64%; }
/* frame styles */
.kc-front[data-frame="rounded"] .kc-photo { border: 0; border-radius: 6cqw; transform: none; margin: 0 0 2cqw; }
.kc-front[data-frame="heart"] .kc-photo { border: 0; transform: none; margin: 0 6cqw 1cqw; box-shadow: none; overflow: visible; background: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cpath d='M50 88 C20 66 2 50 2 28 C2 12 14 2 28 2 C38 2 46 8 50 16 C54 8 62 2 72 2 C86 2 98 12 98 28 C98 50 80 66 50 88Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cpath d='M50 88 C20 66 2 50 2 28 C2 12 14 2 28 2 C38 2 46 8 50 16 C54 8 62 2 72 2 C86 2 98 12 98 28 C98 50 80 66 50 88Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.kc-front[data-frame="heart"] .kc-badge { left: 50%; transform: translateX(-50%); bottom: 14%; }
.kc-front[data-frame="film"] .kc-photo { border: 0; border-radius: 1.5cqw; transform: rotate(1.5deg); padding: 5.5cqw 0; background:
  radial-gradient(circle, #F7EBDD 0 38%, transparent 42%) 0 1.2cqw / 5cqw 3.2cqw repeat-x,
  radial-gradient(circle, #F7EBDD 0 38%, transparent 42%) 0 calc(100% - 1.2cqw) / 5cqw 3.2cqw repeat-x, #141010; }
.kc-front[data-frame="film"] .kc-photo img { border-radius: .8cqw; }
/* full: the photo is the whole card, words sit on top */
.kc-front[data-size="full"] { justify-content: flex-end; }
.kc-front[data-size="full"] .kc-photo { position: absolute; inset: 0; height: auto; margin: 0; border: 0; border-radius: 0; transform: none; box-shadow: none; -webkit-mask: none; mask: none; padding: 0; background: #000; }
.kc-front[data-size="full"] .kc-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.78) 100%); }
.kc-front[data-size="full"] .kc-badge { top: 5cqw; left: 5cqw; bottom: auto; transform: none; z-index: 2; }
.kc-front[data-size="full"] > *:not(.kc-photo) { position: relative; z-index: 2; color: #fff; }
.kc-front[data-size="full"] .kc-where, .kc-front[data-size="full"] .kc-socials a { color: rgba(255, 255, 255, .9); }
.kc-front[data-size="full"] .kc-shades span { background: rgba(255, 255, 255, .2); }
.kc-front[data-size="full"] .kc-name { margin-top: 0; }

/* ---------- review font ---------- */
.kc-front[data-font="bold"] .kc-quote { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 5.6cqw; letter-spacing: -.01em; }
.kc-front[data-font="type"] .kc-quote { font-family: 'Special Elite', 'Courier New', monospace; font-weight: 400; font-size: 4.6cqw; line-height: 1.25; }
.kc-front[data-font="clean"] .kc-quote { font-family: var(--body); font-weight: 700; font-size: 4.6cqw; line-height: 1.25; }
.kc-front[data-font="bold"] .kc-quote.big { font-size: 8.4cqw; }
.kc-front[data-font="type"] .kc-quote.big, .kc-front[data-font="clean"] .kc-quote.big { font-size: 7cqw; }

/* ---------- back backgrounds ---------- */
.kc-back[data-bg="plain"] { background-image: none; }
.kc-back[data-bg="gingham"] { background-image: linear-gradient(90deg, rgba(255,255,255,.22) 50%, transparent 0), linear-gradient(rgba(255,255,255,.22) 50%, transparent 0); background-size: 8cqw 8cqw, 8cqw 8cqw; }
.kc-back[data-bg="stripes"] { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.2) 0 4cqw, transparent 4cqw 8cqw); background-size: auto; }
.kc-back[data-bg="checks"] { background-image: conic-gradient(rgba(255,255,255,.22) 25%, transparent 0 50%, rgba(255,255,255,.22) 0 75%, transparent 0); background-size: 12cqw 12cqw; }
.kc-back[data-bg="glitter"] { background-image:
  radial-gradient(circle at 20% 30%, rgba(255,255,255,.95) 0 .35cqw, transparent .5cqw), radial-gradient(circle at 70% 60%, rgba(255,230,160,.9) 0 .3cqw, transparent .45cqw),
  radial-gradient(circle at 45% 80%, rgba(255,255,255,.7) 0 .25cqw, transparent .4cqw), radial-gradient(circle at 85% 15%, rgba(255,200,220,.9) 0 .3cqw, transparent .45cqw),
  linear-gradient(135deg, rgba(255,255,255,.18), rgba(0,0,0,.12)); background-size: 9cqw 9cqw, 7cqw 7cqw, 5cqw 5cqw, 11cqw 11cqw, auto; }
.kc-back[data-bg="hearts"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M10 16c-4-3-6-5-6-8 0-2 2-4 4-4 1 0 2 1 2 2 0-1 1-2 2-2 2 0 4 2 4 4 0 3-2 5-6 8z' fill='white' fill-opacity='.3'/%3E%3Cpath d='M30 36c-4-3-6-5-6-8 0-2 2-4 4-4 1 0 2 1 2 2 0-1 1-2 2-2 2 0 4 2 4 4 0 3-2 5-6 8z' fill='white' fill-opacity='.18'/%3E%3C/svg%3E"); background-size: 12cqw 12cqw; }
.kc-back[data-bg="stars"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M10 2l2 6h6l-5 4 2 6-5-4-5 4 2-6-5-4h6z' fill='white' fill-opacity='.3'/%3E%3Cpath d='M30 22l1.5 4h4l-3 3 1 4-3.5-2.5-3.5 2.5 1-4-3-3h4z' fill='white' fill-opacity='.2'/%3E%3C/svg%3E"); background-size: 12cqw 12cqw; }
.kc-back[data-bg="snow"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg stroke='white' stroke-opacity='.35' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M15 7v16M7 15h16M9.3 9.3l11.4 11.4M20.7 9.3L9.3 20.7'/%3E%3Cpath d='M45 38v12M39 44h12M40.8 39.8l8.4 8.4M49.2 39.8l-8.4 8.4'/%3E%3C/g%3E%3Ccircle cx='44' cy='14' r='1.6' fill='white' fill-opacity='.4'/%3E%3Ccircle cx='14' cy='46' r='1.3' fill='white' fill-opacity='.4'/%3E%3C/svg%3E"); background-size: 16cqw 16cqw; }
.kc-back[data-bg="leopard"] { background-image: 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='%23000' stroke-opacity='.45' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M10 14c4-6 12-6 14 0M8 18c0 4 4 8 8 7'/%3E%3Cpath d='M46 8c5-3 11 0 11 5M44 12c-1 5 3 8 7 8'/%3E%3Cpath d='M58 44c5-4 12-1 12 5M57 48c0 4 3 8 8 7'/%3E%3Cpath d='M18 50c5-4 12-2 13 4M16 54c0 5 5 8 10 6'/%3E%3Cpath d='M38 66c4-3 9-1 10 3'/%3E%3C/g%3E%3Cg fill='%23000' fill-opacity='.22'%3E%3Cellipse cx='16' cy='20' rx='5' ry='4'/%3E%3Cellipse cx='51' cy='14' rx='4' ry='3.5'/%3E%3Cellipse cx='64' cy='50' rx='4.5' ry='4'/%3E%3Cellipse cx='24' cy='56' rx='5' ry='4'/%3E%3Cellipse cx='43' cy='71' rx='3' ry='2.5'/%3E%3C/g%3E%3C/svg%3E"); background-size: 22cqw 22cqw; }
.kc-back .kc-bgphoto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.kc-back .kc-bgphoto + .kc-bgshade { position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.35)); }

/* show the back without the flip (used when saving a picture of the card) */
.kc.show-back .kc-front { display: none; }
.kc.show-back .kc-back { transform: none; }
.kc.show-back .kc-inner, .kc.show-front .kc-inner { transform: none !important; transition: none; }

/* photo v2: zoom 1 shows the whole photo (blurred copy fills the gaps), zoom in and move freely */
.kc-photo.fit2 .kc-crop { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: #e9dcd8; }
.kc-front[data-frame="polaroid"] .kc-photo.fit2 .kc-crop { border-radius: .8cqw; }
.kc-front[data-frame="film"] .kc-photo.fit2 .kc-crop { inset: 5.5cqw 0; border-radius: .8cqw; }
.kc-photo.fit2 .kc-crop img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.kc-photo.fit2 .kc-fill { inset: -20%; width: 140%; height: 140%; object-fit: cover; filter: blur(3.5cqw) saturate(1.15); opacity: .85; transform: none; }
.kc-photo.fit2 .kc-main { object-fit: contain; object-position: 50% 50%; transform: translate(var(--tx, 0%), var(--ty, 0%)) scale(var(--pz, 1)); transform-origin: 50% 50%; }
/* drag this to make the frame taller or shorter (card maker only) */
.kc-grow { position: relative; z-index: 4; height: 0; align-self: center; margin: -2.6cqw 0 0; }
.kc-grow b { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); width: 9cqw; height: 9cqw; display: grid; place-items: center; border-radius: 50%; background: var(--cherry, #C8203A); color: #fff; box-shadow: 0 1cqw 3cqw rgba(0,0,0,.3); cursor: ns-resize; touch-action: none; }
.kc-grow svg { width: 5cqw; height: 5cqw; }
/* the handle belongs to the front only: never let it show through when the card is flipped */
.kc.flipped .kc-grow, .kc.show-back .kc-grow { display: none; }
