/* DM Gift Shop — video message recorder */

.dmr { font-family: 'Tajawal', sans-serif; color: #2B1E2F; }
.dmr .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dmr-offscreen { position: fixed; left: -9999px; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

/* choose */
.dmr-choose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dmr-big {
	position: relative; min-height: 112px; border-radius: 20px; cursor: pointer;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	font-family: inherit; font-size: 16px; font-weight: 800; text-align: center;
	transition: transform .2s, box-shadow .3s;
}
.dmr-big:active { transform: scale(.96); }
.dmr-rec { border: 0; background: #E5533F; color: #FFFFFF; box-shadow: 0 14px 26px -16px rgba(229,83,63,.9); }
.dmr-rec:disabled { background: #D9CEC6; box-shadow: none; cursor: not-allowed; }
.dmr-up { border: 2px dashed #E0D2C6; background: #FFF6EE; color: #2B1E2F; }
.dmr-up:focus-within { outline: 3px solid #E8A33D; outline-offset: 2px; }
.dmr-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dmr-hint { margin: 10px 2px 0; font-size: 13px; line-height: 1.7; color: #6B5A6E; }

/* camera */
.dmr-cam {
	position: relative; border-radius: 22px; overflow: hidden; background: #1A1219;
	aspect-ratio: 3 / 4; max-height: 70vh; margin: 0 auto;
}
.dmr-live { width: 100%; height: 100%; object-fit: cover; display: block; }
.dmr-live.mirror { transform: scaleX(-1); }
.dmr-top {
	position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
	display: flex; align-items: center; gap: 8px;
	background: rgba(26,18,25,.6); color: #FFFFFF; font-size: 15px; font-weight: 700;
	padding: 6px 14px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.dmr-dot { width: 10px; height: 10px; border-radius: 999px; background: #FF3B30; animation: dmrBlink 1s ease-in-out infinite; }
.dmr-dot[hidden] { display: none; }
.dmr-count {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	font-family: 'Fredoka', 'Tajawal', sans-serif; font-weight: 600; font-size: 120px; color: #FFFFFF;
	text-shadow: 0 6px 30px rgba(0,0,0,.4); pointer-events: none; opacity: 0;
}
.dmr-count.show { animation: dmrCount 1s ease-out both; }
.dmr-controls {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px 20px;
	display: flex; align-items: center; justify-content: space-between;
	background: linear-gradient(to top, rgba(26,18,25,.7), rgba(26,18,25,0));
}
.dmr-cancel {
	min-width: 64px; min-height: 44px; border: 0; background: none; color: #FFFFFF;
	font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.dmr-flip {
	width: 48px; height: 48px; border-radius: 999px; border: 0; cursor: pointer;
	background: rgba(255,255,255,.18); color: #FFFFFF; display: flex; align-items: center; justify-content: center;
}
.dmr-flip:disabled { opacity: .35; }
.dmr-shutter { position: relative; width: 80px; height: 80px; border: 0; padding: 0; background: none; cursor: pointer; }
.dmr-shutter svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.dmr-ring-bg { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 5; }
.dmr-ring { fill: none; stroke: #FFFFFF; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .1s linear, stroke .3s; }
.dmr-ring.late { stroke: #FFB020; }
.dmr-core {
	position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px;
	border-radius: 999px; background: #E5533F; transition: all .25s cubic-bezier(.3,1.4,.5,1);
}
.dmr-shutter.on .dmr-core { width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 8px; }

/* trim */
.dmr-trim { display: flex; flex-direction: column; gap: 10px; }
.dmr-tv { width: 100%; max-height: 52vh; border-radius: 20px; background: #000; object-fit: contain; display: block; }
.dmr-trim-title { margin: 4px 2px 0; font-size: 16px; font-weight: 800; }
.dmr-range input { width: 100%; accent-color: #E5533F; height: 32px; }
.dmr-trim-label { margin: 0 2px; font-size: 14px; color: #5A4A5E; }
.dmr-trim-label b { color: #2B1E2F; }

/* processing */
.dmr-proc { text-align: center; padding: 18px 8px 6px; }
.dmr-giftbox { display: inline-block; animation: dmrFloat 2.6s ease-in-out infinite; }
.dmr-lid { transform-box: fill-box; transform-origin: 50% 100%; animation: dmrLid 1.8s ease-in-out infinite; }
.dmr-proc-title { margin: 8px 0 0; font-size: 18px; font-weight: 800; }
.dmr-bar { margin: 14px auto 0; max-width: 280px; height: 10px; border-radius: 999px; background: #F1E6DC; overflow: hidden; }
.dmr-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: #2E9C86; transition: width .3s; }
.dmr-pct { margin: 8px 0 0; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dmr-small { margin: 6px auto 0; max-width: 300px; font-size: 13px; line-height: 1.7; color: #6B5A6E; }
.dmr-resume { margin-top: 12px; }
.dmr-resume[hidden] { display: none; }

/* done */
.dmr-done { display: flex; flex-direction: column; gap: 12px; }
.dmr-pv { width: 100%; max-height: 56vh; border-radius: 20px; background: #000; display: block; }
.dmr-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dmr-stats span { font-size: 14px; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: #FFF6EE; }
.dmr-stats .dmr-size { background: #E3F1EC; color: #1F6653; }
.dmr-stats .dmr-was { color: #6B5A6E; text-decoration: line-through; font-weight: 600; }

/* buttons + errors */
.dmr-actions { display: flex; gap: 10px; }
.dmr-actions .dmr-btn { flex: 1; }
.dmr-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 50px; padding: 0 18px; border-radius: 16px; border: 0; cursor: pointer;
	background: #2B1E2F; color: #FFFFFF; font-family: inherit; font-size: 16px; font-weight: 800;
	transition: transform .2s, background .3s;
}
.dmr-btn:active { transform: scale(.96); }
.dmr-btn.ghost { background: #FFF6EE; color: #2B1E2F; }
.dmr-btn.saved { background: #23735F; }
.dmr-error { text-align: center; padding: 14px 6px; }
.dmr-error p { margin: 0 0 14px; font-size: 15px; line-height: 1.8; color: #5A4A5E; }

@keyframes dmrBlink { 50% { opacity: .2; } }
@keyframes dmrCount { 0% { opacity: 0; transform: scale(1.8); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.7); } }
@keyframes dmrFloat { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
@keyframes dmrLid { 0%,50%,100% { transform: translateY(0) rotate(0deg); } 65% { transform: translateY(-12px) rotate(-8deg); } 80% { transform: translateY(-3px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) {
	.dmr *, .dmr *::before { animation: none !important; transition: none !important; }
}
